Skip to content

Commit

Permalink
mm/swapfile.c: fix a comment in sys_swapon()
Browse files Browse the repository at this point in the history
ANBZ: torvalds#1075

commit fed98ef upstream.

claim_swapfile now always takes i_rwsem.

Link: http://lkml.kernel.org/r/20200114161225.309792-2-hch@lst.de
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Hongnan Li <hongnan.li@linux.alibaba.com>
Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com>
  • Loading branch information
Christoph Hellwig authored and zychao66 committed May 7, 2022
1 parent 1547d2c commit fca767f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mm/swapfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -3242,7 +3242,7 @@ SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags)
mapping = swap_file->f_mapping;
inode = mapping->host;

/* If S_ISREG(inode->i_mode) will do inode_lock(inode); */
/* will take i_rwsem; */
error = claim_swapfile(p, inode);
if (unlikely(error))
goto bad_swap;
Expand Down

0 comments on commit fca767f

Please sign in to comment.