diff options
-rw-r--r-- | fs/afs/inode.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/fs/afs/inode.c b/fs/afs/inode.c index e6f11da5461b..a12ae3ef8fb4 100644 --- a/fs/afs/inode.c +++ b/fs/afs/inode.c @@ -468,10 +468,22 @@ int afs_getattr(const struct path *path, struct kstat *stat, { struct inode *inode = d_inode(path->dentry); struct afs_vnode *vnode = AFS_FS_I(inode); - int seq = 0; + struct key *key; + int ret, seq = 0; _enter("{ ino=%lu v=%u }", inode->i_ino, inode->i_generation); + if (!(query_flags & AT_STATX_DONT_SYNC) && + !test_bit(AFS_VNODE_CB_PROMISED, &vnode->flags)) { + key = afs_request_key(vnode->volume->cell); + if (IS_ERR(key)) + return PTR_ERR(key); + ret = afs_validate(vnode, key); + key_put(key); + if (ret < 0) + return ret; + } + do { read_seqbegin_or_lock(&vnode->cb_lock, &seq); generic_fillattr(inode, stat); |