Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
7499e44
fuse: refuse a writeback connection whose block is not a page
hbirth Aug 26, 2026
8c2ff0e
fuse: take a DLM read lock for the readahead window
hbirth Aug 21, 2026
df8dba4
fuse: hold DLM grants as a bitmap and drive every path from it
hbirth Sep 1, 2026
8dbaa7d
fuse: carry the write retry flag in iomap's private pointer
hbirth Aug 31, 2026
8b6c052
fuse: retry a DLM grant the server refuses as contended
hbirth Aug 31, 2026
36f2271
fuse: keep a folio writeback could not send
hbirth Aug 31, 2026
0ea5d2b
fuse: keep the local size against an attribute reply already on the wire
hbirth Aug 31, 2026
d54291c
fuse: do not ask for a grant from inside the revoke handler
hbirth Aug 31, 2026
e3b4dcc
fuse: take the writeback grant with no folio held
hbirth Aug 31, 2026
aa780aa
fuse: do not record a grant past what a revoke could mark
hbirth Aug 31, 2026
b7803bb
fuse: say that the readahead grant is taken under the folio locks
hbirth Aug 31, 2026
0afd37f
fuse: bound the range a writeback pass defers
hbirth Aug 31, 2026
9026def
fuse: put a skipped folio back on the dirty list after iomap lets go
hbirth Aug 31, 2026
3db23d8
fuse: fix the two writethrough paths a large folio breaks
hbirth Aug 31, 2026
aa211e9
fuse: do not lose a folio writeback declined to send
hbirth Aug 31, 2026
83aa237
fuse: pin a dlm grant from confirmation to dirty
hbirth Aug 31, 2026
ef6753f
fuse: default large folios off
hbirth Sep 1, 2026
8934c17
fuse: write back before a laundering drop
hbirth Sep 1, 2026
21fb990
fuse: flush before the open time drop
hbirth Sep 1, 2026
2272b0c
fuse: start the fsync writeback before the lock
hbirth Sep 1, 2026
2871de3
fuse: drop the writeback folio token
hbirth Sep 2, 2026
bb81356
fuse: kick writeback on a streamed file
hbirth Sep 2, 2026
71f6c4d
fuse: send a streamed write from write(2)
hbirth Sep 3, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 11 additions & 27 deletions fs/fuse/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -2106,34 +2106,24 @@ int fuse_do_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
WARN_ON(!(attr->ia_valid & ATTR_SIZE));
WARN_ON(attr->ia_size != 0);
if (fc->atomic_o_trunc) {
struct percpu_rw_semaphore *wb_sem = fi->wb_inval_rwsem;

/*
* No need to send request to userspace, since actual
* truncation has already been done by OPEN. But still
* need to truncate page cache.
*
* Revoke and drop under the coherency gate write side,
* like the NOTIFY invalidate path: a gate reader that
* already re-validated its grant must not have the
* lock tree and the cache yanked mid-hold, or it
* would repopulate the truncated range trusting a
* grant that no longer exists. Waiting for gate
* readers here is safe: we hold i_rwsem exclusive, so
* no gate holder can be waiting on it (the write path
* takes i_rwsem before the gate, the read path never
* takes it).
* Dropping every grant here does not need a reader or
* writer fenced out: truncate_pagecache() discards the
* folios rather than writing them, and a write racing
* this is a write racing an O_TRUNC open, which has no
* order to preserve. i_rwsem is held exclusive
* anyway, so no cached write is in progress.
*/
if (wb_sem)
percpu_down_write(wb_sem);
if (fc->dlm && fc->writeback_cache)
fuse_dlm_cache_release_locks(fi);
spin_lock(&fi->lock);
i_size_write(inode, 0);
spin_unlock(&fi->lock);
truncate_pagecache(inode, 0);
if (wb_sem)
percpu_up_write(wb_sem);
goto out;
}
file = NULL;
Expand Down Expand Up @@ -2237,23 +2227,17 @@ int fuse_do_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
*/
if ((is_truncate || !is_wb) &&
S_ISREG(inode->i_mode) && oldsize != outarg.attr.size) {
struct percpu_rw_semaphore *wb_sem = fi->wb_inval_rwsem;

/*
* Revoke and drop under the coherency gate write side; see
* the atomic-O_TRUNC branch above. i_rwsem is held
* exclusive here as well (setattr), so waiting out gate
* readers cannot deadlock.
* Revoke past the new size and drop what is beyond it; see
* the atomic-O_TRUNC branch above for why this needs nothing
* fenced out. i_rwsem is held exclusive here as well.
*/
if (wb_sem)
percpu_down_write(wb_sem);
if (fc->dlm && fc->writeback_cache)
fuse_dlm_unlock_range(fi, outarg.attr.size & PAGE_MASK, -1);
fuse_dlm_unlock_range(fi, outarg.attr.size & PAGE_MASK,
U64_MAX);

truncate_pagecache(inode, outarg.attr.size);
invalidate_inode_pages2(mapping);
if (wb_sem)
percpu_up_write(wb_sem);
}

clear_bit(FUSE_I_SIZE_UNSTABLE, &fi->state);
Expand Down
Loading
Loading