Skip to content

Commit 98b41ff

Browse files
committed
lockd: use locks_inode_context helper
lockd currently doesn't access i_flctx safely. This requires a smp_load_acquire, as the pointer is set via cmpxchg (a release operation). Cc: Trond Myklebust <[email protected]> Cc: Anna Schumaker <[email protected]> Cc: Chuck Lever <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Jeff Layton <[email protected]>
1 parent 87f00ab commit 98b41ff

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fs/lockd/svcsubs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ nlm_traverse_locks(struct nlm_host *host, struct nlm_file *file,
207207
{
208208
struct inode *inode = nlmsvc_file_inode(file);
209209
struct file_lock *fl;
210-
struct file_lock_context *flctx = inode->i_flctx;
210+
struct file_lock_context *flctx = locks_inode_context(inode);
211211
struct nlm_host *lockhost;
212212

213213
if (!flctx || list_empty_careful(&flctx->flc_posix))
@@ -262,7 +262,7 @@ nlm_file_inuse(struct nlm_file *file)
262262
{
263263
struct inode *inode = nlmsvc_file_inode(file);
264264
struct file_lock *fl;
265-
struct file_lock_context *flctx = inode->i_flctx;
265+
struct file_lock_context *flctx = locks_inode_context(inode);
266266

267267
if (file->f_count || !list_empty(&file->f_blocks) || file->f_shares)
268268
return 1;

0 commit comments

Comments
 (0)