Skip to content

Commit

Permalink
gfs2: fix flock panic issue
Browse files Browse the repository at this point in the history
Commit 4f65636 ("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: 4f65636 ("Move locks API users to locks_lock_inode_wait()")
Signed-off-by: Junxiao Bi <junxiao.bi@oracle.com>
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
  • Loading branch information
Junxiao Bi authored and Bob Peterson committed Dec 22, 2015
1 parent 6cc4b6e commit a93a998
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion fs/gfs2/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit a93a998

Please sign in to comment.