Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 24ab158

Browse files
AstralBobAndreas Gruenbacher
authored andcommitted
gfs2: return errors from gfs2_ail_empty_gl
Before this patch, function gfs2_ail_empty_gl did not return errors it encountered from __gfs2_trans_begin. Those errors usually came from the fact that the file system was made read-only, often due to unmount (but theoretically could be due to -o remount,ro), which prevented the transaction from starting. The inability to start a transaction prevented its revokes from being properly written to the journal for glocks during unmount (and transition to ro). That meant glocks could be unlocked without the metadata properly revoked in the journal. So other nodes could grab the glock thinking that their lvb values were correct, but in fact corresponded to the glock without its revokes properly synced. That presented as lvb mismatch errors. This patch allows gfs2_ail_empty_gl to return the error properly to the caller. Signed-off-by: Bob Peterson <[email protected]> Signed-off-by: Andreas Gruenbacher <[email protected]>
1 parent 55534c0 commit 24ab158

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

fs/gfs2/glops.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ static int gfs2_ail_empty_gl(struct gfs2_glock *gl)
9090
struct gfs2_sbd *sdp = gl->gl_name.ln_sbd;
9191
struct gfs2_trans tr;
9292
unsigned int revokes;
93-
int ret;
93+
int ret = 0;
9494

9595
revokes = atomic_read(&gl->gl_ail_count);
9696

@@ -132,7 +132,7 @@ static int gfs2_ail_empty_gl(struct gfs2_glock *gl)
132132
flush:
133133
gfs2_log_flush(sdp, NULL, GFS2_LOG_HEAD_FLUSH_NORMAL |
134134
GFS2_LFC_AIL_EMPTY_GL);
135-
return 0;
135+
return ret;
136136
}
137137

138138
void gfs2_ail_flush(struct gfs2_glock *gl, bool fsync)
@@ -326,7 +326,9 @@ static int inode_go_sync(struct gfs2_glock *gl)
326326
ret = gfs2_inode_metasync(gl);
327327
if (!error)
328328
error = ret;
329-
gfs2_ail_empty_gl(gl);
329+
ret = gfs2_ail_empty_gl(gl);
330+
if (!error)
331+
error = ret;
330332
/*
331333
* Writeback of the data mapping may cause the dirty flag to be set
332334
* so we have to clear it again here.

0 commit comments

Comments
 (0)