Loading fs/locks.c +1 −1 Original line number Diff line number Diff line Loading @@ -2212,7 +2212,7 @@ int fcntl_setlk(unsigned int fd, struct file *filp, unsigned int cmd, */ /* * we need that spin_lock here - it prevents reordering between * update of inode->i_flock and check for it done in close(). * update of i_flctx->flc_posix and check for it done in close(). * rcu_read_lock() wouldn't do. */ spin_lock(¤t->files->file_lock); Loading include/linux/fs.h +10 −9 Original line number Diff line number Diff line Loading @@ -925,12 +925,11 @@ int locks_in_grace(struct net *); * FIXME: should we create a separate "struct lock_request" to help distinguish * these two uses? * * The i_flock list is ordered by: * The varous i_flctx lists are ordered by: * * 1) lock type -- FL_LEASEs first, then FL_FLOCK, and finally FL_POSIX * 2) lock owner * 3) lock range start * 4) lock range end * 1) lock owner * 2) lock range start * 3) lock range end * * Obviously, the last two criteria only matter for POSIX locks. */ Loading Loading @@ -1992,8 +1991,9 @@ static inline int break_lease(struct inode *inode, unsigned int mode) { /* * Since this check is lockless, we must ensure that any refcounts * taken are done before checking inode->i_flock. Otherwise, we could * end up racing with tasks trying to set a new lease on this file. * taken are done before checking i_flctx->flc_lease. Otherwise, we * could end up racing with tasks trying to set a new lease on this * file. */ smp_mb(); if (inode->i_flctx && !list_empty_careful(&inode->i_flctx->flc_lease)) Loading @@ -2005,8 +2005,9 @@ static inline int break_deleg(struct inode *inode, unsigned int mode) { /* * Since this check is lockless, we must ensure that any refcounts * taken are done before checking inode->i_flock. Otherwise, we could * end up racing with tasks trying to set a new lease on this file. * taken are done before checking i_flctx->flc_lease. Otherwise, we * could end up racing with tasks trying to set a new lease on this * file. */ smp_mb(); if (inode->i_flctx && !list_empty_careful(&inode->i_flctx->flc_lease)) Loading Loading
fs/locks.c +1 −1 Original line number Diff line number Diff line Loading @@ -2212,7 +2212,7 @@ int fcntl_setlk(unsigned int fd, struct file *filp, unsigned int cmd, */ /* * we need that spin_lock here - it prevents reordering between * update of inode->i_flock and check for it done in close(). * update of i_flctx->flc_posix and check for it done in close(). * rcu_read_lock() wouldn't do. */ spin_lock(¤t->files->file_lock); Loading
include/linux/fs.h +10 −9 Original line number Diff line number Diff line Loading @@ -925,12 +925,11 @@ int locks_in_grace(struct net *); * FIXME: should we create a separate "struct lock_request" to help distinguish * these two uses? * * The i_flock list is ordered by: * The varous i_flctx lists are ordered by: * * 1) lock type -- FL_LEASEs first, then FL_FLOCK, and finally FL_POSIX * 2) lock owner * 3) lock range start * 4) lock range end * 1) lock owner * 2) lock range start * 3) lock range end * * Obviously, the last two criteria only matter for POSIX locks. */ Loading Loading @@ -1992,8 +1991,9 @@ static inline int break_lease(struct inode *inode, unsigned int mode) { /* * Since this check is lockless, we must ensure that any refcounts * taken are done before checking inode->i_flock. Otherwise, we could * end up racing with tasks trying to set a new lease on this file. * taken are done before checking i_flctx->flc_lease. Otherwise, we * could end up racing with tasks trying to set a new lease on this * file. */ smp_mb(); if (inode->i_flctx && !list_empty_careful(&inode->i_flctx->flc_lease)) Loading @@ -2005,8 +2005,9 @@ static inline int break_deleg(struct inode *inode, unsigned int mode) { /* * Since this check is lockless, we must ensure that any refcounts * taken are done before checking inode->i_flock. Otherwise, we could * end up racing with tasks trying to set a new lease on this file. * taken are done before checking i_flctx->flc_lease. Otherwise, we * could end up racing with tasks trying to set a new lease on this * file. */ smp_mb(); if (inode->i_flctx && !list_empty_careful(&inode->i_flctx->flc_lease)) Loading