gfs2: Get rid of gfs2_io_error_bh_wd
Andreas Gruenbacher
maintainerPATCH 1/1 gfs2: Get rid of gfs2_io_error_bh_wd
[This is a follow-up to patch "gfs2: Introduce concept of a pending withdraw" in Bob's recovery patch queue, which introduces the SDF_WITHDRAWING flag.]
Get rid of gfs2_io_error_bh_wd and make gfs2_io_error_bh withdraw implicitly again. If the SDF_WITHDRAWING flag is set, skip the withdraw. This reverts the rest of commit 9e1a9ecd13b9.
--- fs/gfs2/log.c | 4 ++-- fs/gfs2/lops.c | 2 +- fs/gfs2/meta_io.c | 4 ++-- fs/gfs2/util.c | 8 +++----- fs/gfs2/util.h | 8 ++------ 5 files changed, 10 insertions(+), 16 deletions(-)
fs/gfs2/log.c +2 -2
@@ -107,8 +107,8 @@ __acquires(&sdp->sd_ail_lock)if (!buffer_uptodate (bh) && !test_and_set_bit (SDF_AIL1_IO_ERROR , &sdp->sd_flags)) { -gfs2_io_error_bh (sdp, bh);set_bit (SDF_WITHDRAWING , &sdp->sd_flags); +gfs2_io_error_bh (sdp, bh); }list_move (&bd->bd_ail_st_list, &tr->tr_ail2_list);continue ;
@@ -204,8 +204,8 @@ static void gfs2_ail1_empty_one(struct gfs2_sbd *sdp, struct gfs2_trans *tr)continue ;if (!buffer_uptodate (bh) && !test_and_set_bit (SDF_AIL1_IO_ERROR , &sdp->sd_flags)) { -gfs2_io_error_bh (sdp, bh);set_bit (SDF_WITHDRAWING , &sdp->sd_flags); +gfs2_io_error_bh (sdp, bh); }list_move (&bd->bd_ail_st_list, &tr->tr_ail2_list); }
fs/gfs2/lops.c +1 -1
@@ -48,7 +48,7 @@ void gfs2_pin(struct gfs2_sbd *sdp, struct buffer_head *bh)if (test_set_buffer_pinned (bh))gfs2_assert_withdraw (sdp,0 );if (!buffer_uptodate (bh)) -gfs2_io_error_bh_wd (sdp, bh); +gfs2_io_error_bh (sdp, bh); bd = bh->b_private;/* If this buffer is in the AIL and it has already been written * to in-place disk block, remove it from the AIL.
fs/gfs2/meta_io.c +2 -2
@@ -290,7 +290,7 @@ int gfs2_meta_read(struct gfs2_glock *gl, u64 blkno, int flags,if (unlikely (!buffer_uptodate (bh))) {struct gfs2_trans *tr = current->journal_info;if (tr &&test_bit (TR_TOUCHED , &tr->tr_flags)) -gfs2_io_error_bh_wd (sdp, bh); +gfs2_io_error_bh (sdp, bh);brelse (bh); *bhp =NULL ;return -EIO ;
@@ -317,7 +317,7 @@ int gfs2_meta_wait(struct gfs2_sbd *sdp, struct buffer_head *bh)if (!buffer_uptodate (bh)) {struct gfs2_trans *tr = current->journal_info;if (tr &&test_bit (TR_TOUCHED , &tr->tr_flags)) -gfs2_io_error_bh_wd (sdp, bh); +gfs2_io_error_bh (sdp, bh);return -EIO ; }if (unlikely (gfs2_withdrawn (sdp)))
fs/gfs2/util.c +3 -5
@@ -251,21 +251,19 @@ int gfs2_io_error_i(struct gfs2_sbd *sdp, const char *function, char *file,/** * gfs2_io_error_bh_i - Flag a buffer I/O error -* @withdraw: withdraw the filesystem */ void gfs2_io_error_bh_i (struct gfs2_sbd *sdp,struct buffer_head *bh, -const char *function,char *file,unsigned int line, -bool withdraw) +const char *function,char *file,unsigned int line) { -if (gfs2_withdrawn (sdp)) +if (test_bit (SDF_WITHDRAWN , &sdp->sd_flags))return ;fs_err (sdp,"fatal: I/O error\n" " block = %llu\n" " function = %s, file = %s, line = %u\n" , (unsigned long long )bh->b_blocknr, function, file, line); -if (withdraw) +if (!test_bit (SDF_WITHDRAWING , &sdp->sd_flags))gfs2_lm_withdraw (sdp,NULL ); }
fs/gfs2/util.h +2 -6
@@ -134,14 +134,10 @@ gfs2_io_error_i((sdp), __func__, __FILE__, __LINE__);void gfs2_io_error_bh_i (struct gfs2_sbd *sdp,struct buffer_head *bh, -const char *function,char *file,unsigned int line, -bool withdraw); - -#define gfs2_io_error_bh_wd (sdp, bh) \ -gfs2_io_error_bh_i((sdp), (bh), __func__, __FILE__, __LINE__, true); +const char *function,char *file,unsigned int line);#define gfs2_io_error_bh (sdp, bh) \ -gfs2_io_error_bh_i((sdp), (bh), __func__, __FILE__, __LINE__, false); +gfs2_io_error_bh_i((sdp), (bh), __func__, __FILE__, __LINE__);extern struct kmem_cache *gfs2_glock_cachep;
Signature · 1 line
2.20.1
PATCH 1/1 gfs2: Get rid of gfs2_io_error_bh_wd
----- Original Message -----
Quoted 9 lines
[This is a follow-up to patch "gfs2: Introduce concept of a pending withdraw" in Bob's recovery patch queue, which introduces the
SDF_WITHDRAWINGflag.]Get rid of
gfs2_io_error_bh_wdand makegfs2_io_error_bhwithdraw implicitly again. If theSDF_WITHDRAWINGflag is set, skip the withdraw. This reverts the rest of commit9e1a9ecd13b9.Signed-off-by Andreas Gruenbacher <[email protected]>---
Yeah, looks good.