Commit a93a9983 authored by Junxiao Bi's avatar Junxiao Bi Committed by Bob Peterson

gfs2: fix flock panic issue

Commit 4f656367 ("Move locks API users to locks_lock_inode_wait()")
moved flock/posix lock identify code to locks_lock_inode_wait(), but
missed to set fl_flags to FL_FLOCK which will cause kernel panic in

Fixes: 4f656367 ("Move locks API users to locks_lock_inode_wait()")
Signed-off-by: default avatarJunxiao Bi <>
Signed-off-by: default avatarBob Peterson <>
parent 6cc4b6e8
......@@ -1027,7 +1027,10 @@ static int do_flock(struct file *file, int cmd, struct file_lock *fl)
if (fl_gh->gh_state == state)
goto out;
&(struct file_lock){.fl_type = F_UNLCK});
&(struct file_lock) {
.fl_type = F_UNLCK,
.fl_flags = FL_FLOCK
gfs2_holder_reinit(state, flags, fl_gh);
} else {
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment