Commit 9449bfe
fuse: allow parallel direct writes past EOF
Extending FOPEN_PARALLEL_DIRECT_WRITES writes were forced onto the
exclusive inode lock, re-serializing the parallel phase. The exclusive
lock only bundled "write + advance i_size + undo-on-failure" into one
unit. But i_size is committed by fuse_write_update_attr() under
fi->lock, only on a successful growing write and independent of the
inode rwsem -- so shared-lock writers commit size correctly and have
nothing to undo. Drop the past-EOF exclusive triggers and gate the
whole-file fuse_do_truncate() rollback on holding the exclusive lock.
Lock mode is passed to __fuse_direct_IO(); i_size is committed at the
same point in every path, only the failure rollback differs:
non-exclusive (relaxed, parallel):
fuse_direct_write_iter
fuse_dio_lock -> inode_lock_shared (exclusive=false)
__fuse_direct_IO(.., false)
fuse_direct_io() write to server
fuse_write_update_attr() commit i_size (on success)
no rollback
exclusive (append / caching / !parallel):
fuse_direct_write_iter
fuse_dio_lock -> inode_lock (exclusive=true)
__fuse_direct_IO(.., true)
fuse_direct_io() write to server
fuse_write_update_attr() commit i_size (on success)
ret<0 & extend -> fuse_do_truncate() rollback
exclusive (caching-mode O_DIRECT):
fuse_cache_write_iter -> inode_lock (exclusive)
generic_file_direct_write -> fuse_direct_IO
__fuse_direct_IO(.., true)
fuse_direct_io() write to server
fuse_write_update_attr() commit i_size (on success)
ret<0 & extend -> fuse_do_truncate() rollback
Signed-off-by: Bernd Schubert <bschubert@ddn.com>1 parent 5889fa2 commit 9449bfe
1 file changed
Lines changed: 28 additions & 27 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1560 | 1560 | | |
1561 | 1561 | | |
1562 | 1562 | | |
1563 | | - | |
1564 | | - | |
1565 | | - | |
1566 | | - | |
1567 | | - | |
1568 | | - | |
1569 | | - | |
1570 | 1563 | | |
1571 | 1564 | | |
1572 | 1565 | | |
| |||
1598 | 1591 | | |
1599 | 1592 | | |
1600 | 1593 | | |
1601 | | - | |
1602 | | - | |
1603 | | - | |
1604 | | - | |
1605 | 1594 | | |
1606 | 1595 | | |
1607 | 1596 | | |
| |||
1620 | 1609 | | |
1621 | 1610 | | |
1622 | 1611 | | |
1623 | | - | |
1624 | | - | |
1625 | 1612 | | |
1626 | | - | |
1627 | | - | |
1628 | | - | |
1629 | | - | |
1630 | | - | |
| 1613 | + | |
| 1614 | + | |
| 1615 | + | |
| 1616 | + | |
| 1617 | + | |
1631 | 1618 | | |
1632 | | - | |
1633 | | - | |
1634 | | - | |
| 1619 | + | |
| 1620 | + | |
1635 | 1621 | | |
1636 | 1622 | | |
1637 | 1623 | | |
| |||
2148 | 2134 | | |
2149 | 2135 | | |
2150 | 2136 | | |
2151 | | - | |
| 2137 | + | |
| 2138 | + | |
2152 | 2139 | | |
2153 | 2140 | | |
2154 | 2141 | | |
2155 | 2142 | | |
2156 | 2143 | | |
2157 | 2144 | | |
2158 | | - | |
| 2145 | + | |
| 2146 | + | |
2159 | 2147 | | |
2160 | 2148 | | |
2161 | 2149 | | |
| |||
2178 | 2166 | | |
2179 | 2167 | | |
2180 | 2168 | | |
2181 | | - | |
| 2169 | + | |
2182 | 2170 | | |
2183 | 2171 | | |
2184 | 2172 | | |
| |||
3313 | 3301 | | |
3314 | 3302 | | |
3315 | 3303 | | |
3316 | | - | |
| 3304 | + | |
3317 | 3305 | | |
3318 | 3306 | | |
3319 | 3307 | | |
| |||
3407 | 3395 | | |
3408 | 3396 | | |
3409 | 3397 | | |
3410 | | - | |
3411 | | - | |
| 3398 | + | |
| 3399 | + | |
| 3400 | + | |
| 3401 | + | |
| 3402 | + | |
| 3403 | + | |
3412 | 3404 | | |
3413 | 3405 | | |
3414 | 3406 | | |
3415 | 3407 | | |
3416 | 3408 | | |
3417 | 3409 | | |
| 3410 | + | |
| 3411 | + | |
| 3412 | + | |
| 3413 | + | |
| 3414 | + | |
| 3415 | + | |
| 3416 | + | |
| 3417 | + | |
| 3418 | + | |
3418 | 3419 | | |
3419 | 3420 | | |
3420 | 3421 | | |
| |||
0 commit comments