cifs: use locks_inode_context helper
authorJeff Layton <jlayton@kernel.org>
Wed, 16 Nov 2022 13:49:25 +0000 (08:49 -0500)
committerJeff Layton <jlayton@kernel.org>
Wed, 30 Nov 2022 10:08:10 +0000 (05:08 -0500)
cifs currently doesn't access i_flctx safely. This requires a
smp_load_acquire, as the pointer is set via cmpxchg (a release
operation).

Cc: Steve French <smfrench@samba.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
fs/cifs/file.c

index cd96982..6c14319 100644 (file)
@@ -1413,7 +1413,7 @@ cifs_push_posix_locks(struct cifsFileInfo *cfile)
        struct inode *inode = d_inode(cfile->dentry);
        struct cifs_tcon *tcon = tlink_tcon(cfile->tlink);
        struct file_lock *flock;
-       struct file_lock_context *flctx = inode->i_flctx;
+       struct file_lock_context *flctx = locks_inode_context(inode);
        unsigned int count = 0, i;
        int rc = 0, xid, type;
        struct list_head locks_to_send, *el;