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
claim_swapfile now always takes i_rwsem.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Christoph Hellwig <[email protected]>
Reviewed-by: Andrew Morton <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Christoph Hellwig authored and torvalds committed Feb 21, 2020
1 parent 0ef82fc commit fed98ef
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 @@ -3157,7 +3157,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 fed98ef

Please sign in to comment.