Commit 9f2e8c32 authored by Junxiao Bi's avatar Junxiao Bi Committed by Kleber Sacilotto de Souza

gfs2: fix flock panic issue

BugLink: https://bugs.launchpad.net/bugs/1878232

commit a93a9983 upstream.

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>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarIan May <ian.may@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent 0d021d57
...@@ -1035,7 +1035,10 @@ static int do_flock(struct file *file, int cmd, struct file_lock *fl) ...@@ -1035,7 +1035,10 @@ static int do_flock(struct file *file, int cmd, struct file_lock *fl)
if (fl_gh->gh_state == state) if (fl_gh->gh_state == state)
goto out; goto out;
locks_lock_file_wait(file, 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_glock_dq(fl_gh);
gfs2_holder_reinit(state, flags, fl_gh); gfs2_holder_reinit(state, flags, fl_gh);
} else { } 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