summaryrefslogtreecommitdiff
path: root/fs/gfs2/file.c
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruenba@redhat.com>2022-01-14 09:05:13 +0100
committerAndreas Gruenbacher <agruenba@redhat.com>2022-02-15 15:01:40 +0100
commita4e8145edcfd66b69056c59885770b428eccca59 (patch)
treead4979d4bcc381fa2c36082900350d6618570a8a /fs/gfs2/file.c
parent5a27a43efd1d5cd55dd5988cac596bdea7294d73 (diff)
gfs2: Initialize gh_error in gfs2_glock_nq
The gh_error field if a glock holder is initialized to zero in gfs2_holder_init(). When a locking operation fails, gh_error is set to an error code; when it succeeds, the gh_error value is left unchanged. The field isn't initialized in gfs2_holder_reinit(), which is a problem. Instead of fixing that directly, initialize gh_error in gfs2_glock_nq(). That also obsoletes the assignment in do_flock(). Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Diffstat (limited to 'fs/gfs2/file.c')
-rw-r--r--fs/gfs2/file.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c
index 5bac4f6e8e05..a743a9eb602f 100644
--- a/fs/gfs2/file.c
+++ b/fs/gfs2/file.c
@@ -1497,7 +1497,6 @@ static int do_flock(struct file *file, int cmd, struct file_lock *fl)
if (error != GLR_TRYFAILED)
break;
fl_gh->gh_flags = LM_FLAG_TRY | GL_EXACT;
- fl_gh->gh_error = 0;
msleep(sleeptime);
}
if (error) {