提交 a93a9983 编写于 作者: J Junxiao Bi 提交者: 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: NJunxiao Bi <junxiao.bi@oracle.com>
Signed-off-by: NBob Peterson <rpeterso@redhat.com>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册