summaryrefslogtreecommitdiffstats
path: root/fs/gfs2/util.c
diff options
context:
space:
mode:
authorBob Peterson <rpeterso@redhat.com>2019-05-09 10:21:48 -0400
committerAndreas Gruenbacher <agruenba@redhat.com>2019-06-27 15:27:43 -0400
commit3792ce973f07a2644fd81424b9acacb12530a3cf (patch)
tree63cdc83d302b01d8a8e492c95d985190248123bc /fs/gfs2/util.c
parent55317f5b00f0dc0c807979292362ddc568b5bcc9 (diff)
gfs2: dump fsid when dumping glock problems
Before this patch, if a glock error was encountered, the glock with the problem was dumped. But sometimes you may have lots of file systems mounted, and that doesn't tell you which file system it was for. This patch adds a new boolean parameter fsid to the dump_glock family of functions. For non-error cases, such as dumping the glocks debugfs file, the fsid is not dumped in order to keep lock dumps and glocktop as clean as possible. For all error cases, such as GLOCK_BUG_ON, the file system id is now printed. This will make it easier to debug. Signed-off-by: Bob Peterson <rpeterso@redhat.com> Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Diffstat (limited to 'fs/gfs2/util.c')
-rw-r--r--fs/gfs2/util.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/gfs2/util.c b/fs/gfs2/util.c
index 6aea0146e0c8..83f6c582773a 100644
--- a/fs/gfs2/util.c
+++ b/fs/gfs2/util.c
@@ -178,9 +178,11 @@ int gfs2_consist_rgrpd_i(struct gfs2_rgrpd *rgd, int cluster_wide,
178 const char *function, char *file, unsigned int line) 178 const char *function, char *file, unsigned int line)
179{ 179{
180 struct gfs2_sbd *sdp = rgd->rd_sbd; 180 struct gfs2_sbd *sdp = rgd->rd_sbd;
181 char fs_id_buf[GFS2_FSNAME_LEN + 3 * sizeof(int) + 2];
181 int rv; 182 int rv;
182 183
183 gfs2_rgrp_dump(NULL, rgd->rd_gl); 184 sprintf(fs_id_buf, "fsid=%s: ", sdp->sd_fsname);
185 gfs2_rgrp_dump(NULL, rgd->rd_gl, fs_id_buf);
184 rv = gfs2_lm_withdraw(sdp, 186 rv = gfs2_lm_withdraw(sdp,
185 "fatal: filesystem consistency error\n" 187 "fatal: filesystem consistency error\n"
186 " RG = %llu\n" 188 " RG = %llu\n"