afs: Commit the status on a new file/dir/symlink
authorDavid Howells <dhowells@redhat.com>
Fri, 19 Oct 2018 23:57:57 +0000 (00:57 +0100)
committerDavid Howells <dhowells@redhat.com>
Tue, 23 Oct 2018 23:41:08 +0000 (00:41 +0100)
Call the function to commit the status on a new file, dir or symlink so
that the access rights for the caller's key are cached for that object.

Without this, the next access to the file will cause a FetchStatus
operation to be emitted to retrieve the access rights.

Signed-off-by: David Howells <dhowells@redhat.com>
fs/afs/dir.c

index 024b7cf7441c1d472a49b1ab148f3f0c638fb71e..8936731c59ff8b7ba7619842e7acbd1a2a245c94 100644 (file)
@@ -1089,6 +1089,7 @@ static void afs_vnode_new_inode(struct afs_fs_cursor *fc,
 
        vnode = AFS_FS_I(inode);
        set_bit(AFS_VNODE_NEW_CONTENT, &vnode->flags);
+       afs_vnode_commit_status(fc, vnode, 0);
        d_add(new_dentry, inode);
 }