Commit ade48088 authored by Bob Peterson's avatar Bob Peterson Committed by Andreas Gruenbacher

gfs2: Don't write log headers after file system withdraw

Before this patch, when a node withdrew a gfs2 file system, it
wrote a (clean) unmount log header. That's wrong. You don't want
to write anything to the journal once you're withdrawn because
that's acknowledging that the transaction is complete and the
journal is in good shape, neither of which may be a valid
assumption when the file system is withdrawn. This is especially
true if the withdraw was caused due to io errors writing to the
journal in the first place. The best course of action is to leave
the journal "as is" until it may be safely replayed during
journal recovery, regardless of whether it's done by this node or
another.
Signed-off-by: default avatarBob Peterson <rpeterso@redhat.com>
Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
parent 8f81180a
...@@ -693,12 +693,16 @@ void gfs2_write_log_header(struct gfs2_sbd *sdp, struct gfs2_jdesc *jd, ...@@ -693,12 +693,16 @@ void gfs2_write_log_header(struct gfs2_sbd *sdp, struct gfs2_jdesc *jd,
{ {
struct gfs2_log_header *lh; struct gfs2_log_header *lh;
u32 hash, crc; u32 hash, crc;
struct page *page = mempool_alloc(gfs2_page_pool, GFP_NOIO); struct page *page;
struct gfs2_statfs_change_host *l_sc = &sdp->sd_statfs_local; struct gfs2_statfs_change_host *l_sc = &sdp->sd_statfs_local;
struct timespec64 tv; struct timespec64 tv;
struct super_block *sb = sdp->sd_vfs; struct super_block *sb = sdp->sd_vfs;
u64 dblock; u64 dblock;
if (gfs2_withdrawn(sdp))
goto out;
page = mempool_alloc(gfs2_page_pool, GFP_NOIO);
lh = page_address(page); lh = page_address(page);
clear_page(lh); clear_page(lh);
...@@ -751,6 +755,7 @@ void gfs2_write_log_header(struct gfs2_sbd *sdp, struct gfs2_jdesc *jd, ...@@ -751,6 +755,7 @@ void gfs2_write_log_header(struct gfs2_sbd *sdp, struct gfs2_jdesc *jd,
gfs2_log_write(sdp, page, sb->s_blocksize, 0, dblock); gfs2_log_write(sdp, page, sb->s_blocksize, 0, dblock);
gfs2_log_submit_bio(&sdp->sd_log_bio, REQ_OP_WRITE | op_flags); gfs2_log_submit_bio(&sdp->sd_log_bio, REQ_OP_WRITE | op_flags);
out:
log_flush_wait(sdp); log_flush_wait(sdp);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment