Skip to content

Commit 4d62d3f

Browse files
NeilBrownjtlayton
authored andcommitted
gfs2: properly initial file_lock used for unlock.
Rather than assuming all-zeros is sufficient, use the available API to initialize the file_lock structure use for unlock. VFS-level changes will soon make it important that the list_heads in file_lock are always properly initialized. Signed-off-by: NeilBrown <[email protected]> Reviewed-by: J. Bruce Fields <[email protected]> Signed-off-by: Jeff Layton <[email protected]>
1 parent 7b587e1 commit 4d62d3f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

fs/gfs2/file.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1199,13 +1199,13 @@ static int do_flock(struct file *file, int cmd, struct file_lock *fl)
11991199
mutex_lock(&fp->f_fl_mutex);
12001200

12011201
if (gfs2_holder_initialized(fl_gh)) {
1202+
struct file_lock request;
12021203
if (fl_gh->gh_state == state)
12031204
goto out;
1204-
locks_lock_file_wait(file,
1205-
&(struct file_lock) {
1206-
.fl_type = F_UNLCK,
1207-
.fl_flags = FL_FLOCK
1208-
});
1205+
locks_init_lock(&request);
1206+
request.fl_type = F_UNLCK;
1207+
request.fl_flags = FL_FLOCK;
1208+
locks_lock_file_wait(file, &request);
12091209
gfs2_glock_dq(fl_gh);
12101210
gfs2_holder_reinit(state, flags, fl_gh);
12111211
} else {

0 commit comments

Comments
 (0)