summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2018-04-06 09:17:24 -0400
committerDavid Howells <dhowells@redhat.com>2018-04-09 16:53:55 -0400
commit5800db810a2308544a9e42686a2fc7f8682418ba (patch)
tree0aa975627cccb7a387befe587ad202e250a4d7b8 /fs
parentd55b4da4331efdfe2be1bcc7bc217bd3f7c47870 (diff)
afs: Init inode before accessing cache
We no longer parse symlinks when we get the inode to determine if this symlink is actually a mountpoint as we detect that by examining the mode instead (symlinks are always 0777 and mountpoints 0644). Access the cache after mapping the status so that we don't have to manually set the inode size now. Note that this may need adjusting if the disconnected operation is implemented as the file metadata may have to be obtained from the cache. Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/afs/inode.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/fs/afs/inode.c b/fs/afs/inode.c
index f4e62964efcb..bcaff40b664d 100644
--- a/fs/afs/inode.c
+++ b/fs/afs/inode.c
@@ -331,15 +331,12 @@ struct inode *afs_iget(struct super_block *sb, struct key *key,
331 vnode->cb_expires_at += ktime_get_real_seconds(); 331 vnode->cb_expires_at += ktime_get_real_seconds();
332 } 332 }
333 333
334 /* set up caching before mapping the status, as map-status reads the
335 * first page of symlinks to see if they're really mountpoints */
336 inode->i_size = vnode->status.size;
337 afs_get_inode_cache(vnode);
338
339 ret = afs_inode_map_status(vnode, key); 334 ret = afs_inode_map_status(vnode, key);
340 if (ret < 0) 335 if (ret < 0)
341 goto bad_inode; 336 goto bad_inode;
342 337
338 afs_get_inode_cache(vnode);
339
343 /* success */ 340 /* success */
344 clear_bit(AFS_VNODE_UNSET, &vnode->flags); 341 clear_bit(AFS_VNODE_UNSET, &vnode->flags);
345 inode->i_flags |= S_NOATIME; 342 inode->i_flags |= S_NOATIME;