aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-12-27 20:12:30 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2018-12-27 20:12:30 -0500
commit00c569b567c7f1f0da6162868fd02a9f29411805 (patch)
tree348a163b95b02363280eaf59df1bbd216176c6be /fs/gfs2
parentf6b1495fba0b66cfa05efa0ca2370513b79b45b6 (diff)
parent052b8cfa4070caa53125cd589da0cfe744132a94 (diff)
Merge tag 'locks-v4.21-1' of git://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux
Pull file locking updates from Jeff Layton: "The main change in this set is Neil Brown's work to reduce the thundering herd problem when a heavily-contended file lock is released. Previously we'd always wake up all waiters when this occurred. With this set, we'll now we only wake up waiters that were blocked on the range being released" * tag 'locks-v4.21-1' of git://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux: locks: Use inode_is_open_for_write fs/locks: remove unnecessary white space. fs/locks: merge posix_unblock_lock() and locks_delete_block() fs/locks: create a tree of dependent requests. fs/locks: change all *_conflict() functions to return bool. fs/locks: always delete_block after waiting. fs/locks: allow a lock request to block other requests. fs/locks: use properly initialized file_lock when unlocking. ocfs2: properly initial file_lock used for unlock. gfs2: properly initial file_lock used for unlock. NFS: use locks_copy_lock() to copy locks. fs/locks: split out __locks_wake_up_blocks(). fs/locks: rename some lists and pointers.
Diffstat (limited to 'fs/gfs2')
-rw-r--r--fs/gfs2/file.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c
index 45a17b770d97..a2dea5bc0427 100644
--- a/fs/gfs2/file.c
+++ b/fs/gfs2/file.c
@@ -1199,13 +1199,13 @@ static int do_flock(struct file *file, int cmd, struct file_lock *fl)
1199 mutex_lock(&fp->f_fl_mutex); 1199 mutex_lock(&fp->f_fl_mutex);
1200 1200
1201 if (gfs2_holder_initialized(fl_gh)) { 1201 if (gfs2_holder_initialized(fl_gh)) {
1202 struct file_lock request;
1202 if (fl_gh->gh_state == state) 1203 if (fl_gh->gh_state == state)
1203 goto out; 1204 goto out;
1204 locks_lock_file_wait(file, 1205 locks_init_lock(&request);
1205 &(struct file_lock) { 1206 request.fl_type = F_UNLCK;
1206 .fl_type = F_UNLCK, 1207 request.fl_flags = FL_FLOCK;
1207 .fl_flags = FL_FLOCK 1208 locks_lock_file_wait(file, &request);
1208 });
1209 gfs2_glock_dq(fl_gh); 1209 gfs2_glock_dq(fl_gh);
1210 gfs2_holder_reinit(state, flags, fl_gh); 1210 gfs2_holder_reinit(state, flags, fl_gh);
1211 } else { 1211 } else {