mirror of
https://github.com/torvalds/linux.git
synced 2026-07-28 01:55:51 +02:00
afs: Fix directory inode initialisation order
Fix afs_inode_init_from_status() to call afs_set_netfs_context() before the
switch to do file type-specific initialisation because local directory
changes don't get uploaded to the server, only stored in the cache.
This requires that the file size be set before, so move that up too.
Without this, NETFS_ICTX_SINGLE_NO_UPLOAD as set on directories gets
clobbered.
Closes: https://sashiko.dev/#/patchset/20260618074903.2374756-1-dhowells%40redhat.com
Signed-off-by: David Howells <dhowells@redhat.com>
Link: https://patch.msgid.link/20260622090856.2746629-7-dhowells@redhat.com
Fixes: 6dd8093661 ("afs: Use netfslib for directories")
cc: Marc Dionne <marc.dionne@auristor.com>
cc: linux-afs@lists.infradead.org
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
This commit is contained in:
parent
81e985b4c3
commit
35b177ef54
|
|
@ -93,6 +93,10 @@ static int afs_inode_init_from_status(struct afs_operation *op,
|
|||
inode->i_gid = make_kgid(&init_user_ns, status->group);
|
||||
set_nlink(&vnode->netfs.inode, status->nlink);
|
||||
|
||||
i_size_write(inode, status->size);
|
||||
inode_set_bytes(inode, status->size);
|
||||
afs_set_netfs_context(vnode, status->type == AFS_FTYPE_FILE);
|
||||
|
||||
switch (status->type) {
|
||||
case AFS_FTYPE_FILE:
|
||||
inode->i_mode = S_IFREG | (status->mode & S_IALLUGO);
|
||||
|
|
@ -133,10 +137,6 @@ static int afs_inode_init_from_status(struct afs_operation *op,
|
|||
return afs_protocol_error(NULL, afs_eproto_file_type);
|
||||
}
|
||||
|
||||
i_size_write(inode, status->size);
|
||||
inode_set_bytes(inode, status->size);
|
||||
afs_set_netfs_context(vnode, status->type == AFS_FTYPE_FILE);
|
||||
|
||||
vnode->invalid_before = status->data_version;
|
||||
trace_afs_set_dv(vnode, status->data_version);
|
||||
inode_set_iversion_raw(&vnode->netfs.inode, status->data_version);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user