From: Jeff Layton Date: Wed, 16 Nov 2022 13:49:25 +0000 (-0500) Subject: cifs: use locks_inode_context helper X-Git-Tag: v6.2-rc1~214^2~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a1fde8ee771f92d2a8bbd79532149ddd34546bc1;p=thirdparty%2Fkernel%2Flinux.git cifs: use locks_inode_context helper 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 Reviewed-by: Christoph Hellwig Signed-off-by: Jeff Layton --- diff --git a/fs/cifs/file.c b/fs/cifs/file.c index cd96982099309..6c14319794958 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c @@ -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;