diff options
-rw-r--r-- | fs/locks.c | 2 | ||||
-rw-r--r-- | include/linux/fs.h | 19 |
2 files changed, 11 insertions, 10 deletions
diff --git a/fs/locks.c b/fs/locks.c index 2fc36b3772a0..4d0d41163a50 100644 --- a/fs/locks.c +++ b/fs/locks.c | |||
@@ -2212,7 +2212,7 @@ again: | |||
2212 | */ | 2212 | */ |
2213 | /* | 2213 | /* |
2214 | * we need that spin_lock here - it prevents reordering between | 2214 | * we need that spin_lock here - it prevents reordering between |
2215 | * update of inode->i_flock and check for it done in close(). | 2215 | * update of i_flctx->flc_posix and check for it done in close(). |
2216 | * rcu_read_lock() wouldn't do. | 2216 | * rcu_read_lock() wouldn't do. |
2217 | */ | 2217 | */ |
2218 | spin_lock(¤t->files->file_lock); | 2218 | spin_lock(¤t->files->file_lock); |
diff --git a/include/linux/fs.h b/include/linux/fs.h index f87cb2f03103..ddd2fa7cefd3 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -925,12 +925,11 @@ int locks_in_grace(struct net *); | |||
925 | * FIXME: should we create a separate "struct lock_request" to help distinguish | 925 | * FIXME: should we create a separate "struct lock_request" to help distinguish |
926 | * these two uses? | 926 | * these two uses? |
927 | * | 927 | * |
928 | * The i_flock list is ordered by: | 928 | * The varous i_flctx lists are ordered by: |
929 | * | 929 | * |
930 | * 1) lock type -- FL_LEASEs first, then FL_FLOCK, and finally FL_POSIX | 930 | * 1) lock owner |
931 | * 2) lock owner | 931 | * 2) lock range start |
932 | * 3) lock range start | 932 | * 3) lock range end |
933 | * 4) lock range end | ||
934 | * | 933 | * |
935 | * Obviously, the last two criteria only matter for POSIX locks. | 934 | * Obviously, the last two criteria only matter for POSIX locks. |
936 | */ | 935 | */ |
@@ -1992,8 +1991,9 @@ static inline int break_lease(struct inode *inode, unsigned int mode) | |||
1992 | { | 1991 | { |
1993 | /* | 1992 | /* |
1994 | * Since this check is lockless, we must ensure that any refcounts | 1993 | * Since this check is lockless, we must ensure that any refcounts |
1995 | * taken are done before checking inode->i_flock. Otherwise, we could | 1994 | * taken are done before checking i_flctx->flc_lease. Otherwise, we |
1996 | * end up racing with tasks trying to set a new lease on this file. | 1995 | * could end up racing with tasks trying to set a new lease on this |
1996 | * file. | ||
1997 | */ | 1997 | */ |
1998 | smp_mb(); | 1998 | smp_mb(); |
1999 | if (inode->i_flctx && !list_empty_careful(&inode->i_flctx->flc_lease)) | 1999 | if (inode->i_flctx && !list_empty_careful(&inode->i_flctx->flc_lease)) |
@@ -2005,8 +2005,9 @@ static inline int break_deleg(struct inode *inode, unsigned int mode) | |||
2005 | { | 2005 | { |
2006 | /* | 2006 | /* |
2007 | * Since this check is lockless, we must ensure that any refcounts | 2007 | * Since this check is lockless, we must ensure that any refcounts |
2008 | * taken are done before checking inode->i_flock. Otherwise, we could | 2008 | * taken are done before checking i_flctx->flc_lease. Otherwise, we |
2009 | * end up racing with tasks trying to set a new lease on this file. | 2009 | * could end up racing with tasks trying to set a new lease on this |
2010 | * file. | ||
2010 | */ | 2011 | */ |
2011 | smp_mb(); | 2012 | smp_mb(); |
2012 | if (inode->i_flctx && !list_empty_careful(&inode->i_flctx->flc_lease)) | 2013 | if (inode->i_flctx && !list_empty_careful(&inode->i_flctx->flc_lease)) |