diff options
author | Junxiao Bi <junxiao.bi@oracle.com> | 2015-12-22 09:06:08 -0500 |
---|---|---|
committer | Bob Peterson <rpeterso@redhat.com> | 2015-12-22 09:06:08 -0500 |
commit | a93a99838248bdab49db2eaac00236847670bc7f (patch) | |
tree | 6878b5d6ee05d7af15a75f3f0985528003cb5ae4 /fs/gfs2/file.c | |
parent | 6cc4b6e801c725321e9f63ca7c2d00af8df24699 (diff) |
gfs2: fix flock panic issue
Commit 4f6563677ae8 ("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: 4f6563677ae8 ("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>
Diffstat (limited to 'fs/gfs2/file.c')
-rw-r--r-- | fs/gfs2/file.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c index 860408053c95..7412863cda1e 100644 --- a/fs/gfs2/file.c +++ b/fs/gfs2/file.c | |||
@@ -1027,7 +1027,10 @@ static int do_flock(struct file *file, int cmd, struct file_lock *fl) | |||
1027 | if (fl_gh->gh_state == state) | 1027 | if (fl_gh->gh_state == state) |
1028 | goto out; | 1028 | goto out; |
1029 | locks_lock_file_wait(file, | 1029 | locks_lock_file_wait(file, |
1030 | &(struct file_lock){.fl_type = F_UNLCK}); | 1030 | &(struct file_lock) { |
1031 | .fl_type = F_UNLCK, | ||
1032 | .fl_flags = FL_FLOCK | ||
1033 | }); | ||
1031 | gfs2_glock_dq(fl_gh); | 1034 | gfs2_glock_dq(fl_gh); |
1032 | gfs2_holder_reinit(state, flags, fl_gh); | 1035 | gfs2_holder_reinit(state, flags, fl_gh); |
1033 | } else { | 1036 | } else { |