diff options
-rw-r--r-- | include/linux/fs.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index c3f46e499dd0..22ae79650b82 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -1914,6 +1914,12 @@ static inline int break_lease(struct inode *inode, unsigned int mode) | |||
1914 | 1914 | ||
1915 | static inline int break_deleg(struct inode *inode, unsigned int mode) | 1915 | static inline int break_deleg(struct inode *inode, unsigned int mode) |
1916 | { | 1916 | { |
1917 | /* | ||
1918 | * Since this check is lockless, we must ensure that any refcounts | ||
1919 | * taken are done before checking inode->i_flock. Otherwise, we could | ||
1920 | * end up racing with tasks trying to set a new lease on this file. | ||
1921 | */ | ||
1922 | smp_mb(); | ||
1917 | if (inode->i_flock) | 1923 | if (inode->i_flock) |
1918 | return __break_lease(inode, mode, FL_DELEG); | 1924 | return __break_lease(inode, mode, FL_DELEG); |
1919 | return 0; | 1925 | return 0; |