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
locks_lock_inode_wait().

Fixes: 4f656367 ("Move locks API users to locks_lock_inode_wait()")
Signed-off-by: default avatarJunxiao Bi <junxiao.bi@oracle.com>
Signed-off-by: default avatarBob Peterson <rpeterso@redhat.com>
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;
locks_lock_file_wait(file,
&(struct file_lock){.fl_type = F_UNLCK});
&(struct file_lock) {
.fl_type = F_UNLCK,
.fl_flags = FL_FLOCK
});
gfs2_glock_dq(fl_gh);
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