diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-06-21 22:40:30 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-06-21 22:40:30 -0400 |
| commit | 2dfded821097be62dc7ba20d53a9c96d0de13134 (patch) | |
| tree | c686cdb704fe91337e8e7ea5253c9582b407e51c /include/linux | |
| parent | 532f51388b0432f41f4a178a98207ba1d81149f7 (diff) | |
| parent | 0c27362998a8357f199501aa401e99c51c2eb46e (diff) | |
Merge tag 'locks-v3.16-2' of git://git.samba.org/jlayton/linux
Pull file locking fixes from Jeff Layton:
"File locking related bugfixes
Nothing too earth-shattering here. A fix for a potential regression
due to a patch in pile #1, and the addition of a memory barrier to
prevent a race condition between break_deleg and generic_add_lease"
* tag 'locks-v3.16-2' of git://git.samba.org/jlayton/linux:
locks: set fl_owner for leases back to current->files
locks: add missing memory barrier in break_deleg
Diffstat (limited to 'include/linux')
| -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 338e6f758c6d..e11d60cc867b 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
| @@ -1921,6 +1921,12 @@ static inline int break_lease(struct inode *inode, unsigned int mode) | |||
| 1921 | 1921 | ||
| 1922 | static inline int break_deleg(struct inode *inode, unsigned int mode) | 1922 | static inline int break_deleg(struct inode *inode, unsigned int mode) |
| 1923 | { | 1923 | { |
| 1924 | /* | ||
| 1925 | * Since this check is lockless, we must ensure that any refcounts | ||
| 1926 | * taken are done before checking inode->i_flock. Otherwise, we could | ||
| 1927 | * end up racing with tasks trying to set a new lease on this file. | ||
| 1928 | */ | ||
| 1929 | smp_mb(); | ||
| 1924 | if (inode->i_flock) | 1930 | if (inode->i_flock) |
| 1925 | return __break_lease(inode, mode, FL_DELEG); | 1931 | return __break_lease(inode, mode, FL_DELEG); |
| 1926 | return 0; | 1932 | return 0; |
