]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit - fs/locks.c
filelock: add a new locks_inode_context accessor function
authorJeff Layton <jlayton@kernel.org>
Wed, 16 Nov 2022 14:02:30 +0000 (09:02 -0500)
committerJeff Layton <jlayton@kernel.org>
Wed, 30 Nov 2022 10:08:10 +0000 (05:08 -0500)
commit401a8b8fd5acd51582b15238d72a8d0edd580e9f
tree7b8c736ac196067e55416586ad2e5a7b99216b6d
parentab1ddef98a715eddb65309ffa83267e4e84a571e
filelock: add a new locks_inode_context accessor function

There are a number of places in the kernel that are accessing the
inode->i_flctx field without smp_load_acquire. This is required to
ensure that the caller doesn't see a partially-initialized structure.

Add a new accessor function for it to make this clear and convert all of
the relevant accesses in locks.c to use it. Also, convert
locks_free_lock_context to use the helper as well instead of just doing
a "bare" assignment.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
fs/locks.c
include/linux/fs.h