* [Cluster-devel] [GFS2 PATCH] gfs2: print fsid when rgrp errors are found
[not found] <419461880.18103216.1538666268798.JavaMail.zimbra@redhat.com>
@ 2018-10-04 15:18 ` Bob Peterson
2018-10-04 15:20 ` Steven Whitehouse
0 siblings, 1 reply; 2+ messages in thread
From: Bob Peterson @ 2018-10-04 15:18 UTC (permalink / raw)
To: cluster-devel.redhat.com
Hi,
This patch allows gfs2_setbit to provide useful debug information when
bitmap errors are encountered. It now provides the file system id so
you can tell which mount point the error occurred, as well as the
intended block and the bitmap's block number.
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
---
fs/gfs2/rgrp.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c
index fc181c81cca2..506d09d70b8a 100644
--- a/fs/gfs2/rgrp.c
+++ b/fs/gfs2/rgrp.c
@@ -101,12 +101,16 @@ static inline void gfs2_setbit(const struct gfs2_rbm *rbm, bool do_clone,
cur_state = (*byte1 >> bit) & GFS2_BIT_MASK;
if (unlikely(!valid_change[new_state * 4 + cur_state])) {
- pr_warn("buf_blk = 0x%x old_state=%d, new_state=%d\n",
+ struct gfs2_sbd *sdp = rbm->rgd->rd_sbd;
+
+ fs_warn(sdp, "buf_blk = 0x%x old_state=%d, new_state=%d\n",
rbm->offset, cur_state, new_state);
- pr_warn("rgrp=0x%llx bi_start=0x%x\n",
- (unsigned long long)rbm->rgd->rd_addr, bi->bi_start);
- pr_warn("bi_offset=0x%x bi_len=0x%x\n",
- bi->bi_offset, bi->bi_len);
+ fs_warn(sdp, "rgrp=0x%llx bi_start=0x%x biblk: 0x%llx\n",
+ (unsigned long long)rbm->rgd->rd_addr, bi->bi_start,
+ (unsigned long long)bi->bi_bh->b_blocknr);
+ fs_warn(sdp, "bi_offset=0x%x bi_len=0x%x block=0x%llx\n",
+ bi->bi_offset, bi->bi_len,
+ (unsigned long long)gfs2_rbm_to_block(rbm));
dump_stack();
gfs2_consist_rgrpd(rbm->rgd);
return;
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [Cluster-devel] [GFS2 PATCH] gfs2: print fsid when rgrp errors are found
2018-10-04 15:18 ` [Cluster-devel] [GFS2 PATCH] gfs2: print fsid when rgrp errors are found Bob Peterson
@ 2018-10-04 15:20 ` Steven Whitehouse
0 siblings, 0 replies; 2+ messages in thread
From: Steven Whitehouse @ 2018-10-04 15:20 UTC (permalink / raw)
To: cluster-devel.redhat.com
Hi,
Presumably the other calls to pr_warn have the same issue? Perhaps we
should just get rid of pr_warn completely unless there are cases where a
super block is not available to pass to fs_warn,
Steve.
On 04/10/18 16:18, Bob Peterson wrote:
> Hi,
>
> This patch allows gfs2_setbit to provide useful debug information when
> bitmap errors are encountered. It now provides the file system id so
> you can tell which mount point the error occurred, as well as the
> intended block and the bitmap's block number.
>
> Signed-off-by: Bob Peterson <rpeterso@redhat.com>
> ---
> fs/gfs2/rgrp.c | 14 +++++++++-----
> 1 file changed, 9 insertions(+), 5 deletions(-)
>
> diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c
> index fc181c81cca2..506d09d70b8a 100644
> --- a/fs/gfs2/rgrp.c
> +++ b/fs/gfs2/rgrp.c
> @@ -101,12 +101,16 @@ static inline void gfs2_setbit(const struct gfs2_rbm *rbm, bool do_clone,
> cur_state = (*byte1 >> bit) & GFS2_BIT_MASK;
>
> if (unlikely(!valid_change[new_state * 4 + cur_state])) {
> - pr_warn("buf_blk = 0x%x old_state=%d, new_state=%d\n",
> + struct gfs2_sbd *sdp = rbm->rgd->rd_sbd;
> +
> + fs_warn(sdp, "buf_blk = 0x%x old_state=%d, new_state=%d\n",
> rbm->offset, cur_state, new_state);
> - pr_warn("rgrp=0x%llx bi_start=0x%x\n",
> - (unsigned long long)rbm->rgd->rd_addr, bi->bi_start);
> - pr_warn("bi_offset=0x%x bi_len=0x%x\n",
> - bi->bi_offset, bi->bi_len);
> + fs_warn(sdp, "rgrp=0x%llx bi_start=0x%x biblk: 0x%llx\n",
> + (unsigned long long)rbm->rgd->rd_addr, bi->bi_start,
> + (unsigned long long)bi->bi_bh->b_blocknr);
> + fs_warn(sdp, "bi_offset=0x%x bi_len=0x%x block=0x%llx\n",
> + bi->bi_offset, bi->bi_len,
> + (unsigned long long)gfs2_rbm_to_block(rbm));
> dump_stack();
> gfs2_consist_rgrpd(rbm->rgd);
> return;
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-10-04 15:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <419461880.18103216.1538666268798.JavaMail.zimbra@redhat.com>
2018-10-04 15:18 ` [Cluster-devel] [GFS2 PATCH] gfs2: print fsid when rgrp errors are found Bob Peterson
2018-10-04 15:20 ` Steven Whitehouse
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).