aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/fs.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 09f553c59813..df8474408331 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1964,6 +1964,12 @@ static inline int locks_verify_truncate(struct inode *inode,
1964 1964
1965static inline int break_lease(struct inode *inode, unsigned int mode) 1965static inline int break_lease(struct inode *inode, unsigned int mode)
1966{ 1966{
1967 /*
1968 * Since this check is lockless, we must ensure that any refcounts
1969 * taken are done before checking inode->i_flock. Otherwise, we could
1970 * end up racing with tasks trying to set a new lease on this file.
1971 */
1972 smp_mb();
1967 if (inode->i_flock) 1973 if (inode->i_flock)
1968 return __break_lease(inode, mode, FL_LEASE); 1974 return __break_lease(inode, mode, FL_LEASE);
1969 return 0; 1975 return 0;