diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-03-30 15:13:04 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-03-30 15:13:04 -0700 |
commit | 6c310bc1acdd02110182a2ec6efa3e7571a3b80c (patch) | |
tree | d064cf352a25f9485b74cb03520fcab7f93859b3 /fs | |
parent | 32374ea8fe1196e045c9e74078a662664af8971c (diff) | |
parent | a901125c65544aa05c52e1a7388c3900e8af105f (diff) | |
download | linux-stable-6c310bc1acdd02110182a2ec6efa3e7571a3b80c.tar.gz linux-stable-6c310bc1acdd02110182a2ec6efa3e7571a3b80c.tar.bz2 linux-stable-6c310bc1acdd02110182a2ec6efa3e7571a3b80c.zip |
Merge tag 'locks-v4.0-5' of git://git.samba.org/jlayton/linux
Pull file locking fix from Jeff Layton:
"Another small fix for the lease overhaul"
* tag 'locks-v4.0-5' of git://git.samba.org/jlayton/linux:
locks: fix file_lock deletion inside loop
Diffstat (limited to 'fs')
-rw-r--r-- | fs/locks.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/locks.c b/fs/locks.c index 528fedfda15e..40bc384728c0 100644 --- a/fs/locks.c +++ b/fs/locks.c @@ -1388,9 +1388,8 @@ any_leases_conflict(struct inode *inode, struct file_lock *breaker) int __break_lease(struct inode *inode, unsigned int mode, unsigned int type) { int error = 0; - struct file_lock *new_fl; struct file_lock_context *ctx = inode->i_flctx; - struct file_lock *fl; + struct file_lock *new_fl, *fl, *tmp; unsigned long break_time; int want_write = (mode & O_ACCMODE) != O_RDONLY; LIST_HEAD(dispose); @@ -1420,7 +1419,7 @@ int __break_lease(struct inode *inode, unsigned int mode, unsigned int type) break_time++; /* so that 0 means no break time */ } - list_for_each_entry(fl, &ctx->flc_lease, fl_list) { + list_for_each_entry_safe(fl, tmp, &ctx->flc_lease, fl_list) { if (!leases_conflict(fl, new_fl)) continue; if (want_write) { |