Skip to content

Commit b204b1b

Browse files
author
Andreas Gruenbacher
committed
gfs2: Get rid of newlines in log messages
Get rid of attempts to create multi-line syslog entries; this only makes the messages harder to read. Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
1 parent 10398ef commit b204b1b

3 files changed

Lines changed: 32 additions & 30 deletions

File tree

fs/gfs2/bmap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1827,7 +1827,7 @@ static int punch_hole(struct gfs2_inode *ip, u64 offset, u64 length)
18271827
gfs2_assert_withdraw(sdp, bh);
18281828
if (gfs2_assert_withdraw(sdp,
18291829
prev_bnr != bh->b_blocknr)) {
1830-
fs_emerg(sdp, "inode %llu, block:%llu, i_h:%u,"
1830+
fs_emerg(sdp, "inode %llu, block:%llu, i_h:%u, "
18311831
"s_h:%u, mp_h:%u\n",
18321832
(unsigned long long)ip->i_no_addr,
18331833
prev_bnr, ip->i_height, strip_h, mp_h);

fs/gfs2/rgrp.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -814,11 +814,11 @@ static int compute_bitstructs(struct gfs2_rgrpd *rgd)
814814
bi = rgd->rd_bits + (length - 1);
815815
if ((bi->bi_start + bi->bi_bytes) * GFS2_NBBY != rgd->rd_data) {
816816
gfs2_lm(sdp,
817-
"ri_addr = %llu\n"
818-
"ri_length = %u\n"
819-
"ri_data0 = %llu\n"
820-
"ri_data = %u\n"
821-
"ri_bitbytes = %u\n"
817+
"ri_addr=%llu "
818+
"ri_length=%u "
819+
"ri_data0=%llu "
820+
"ri_data=%u "
821+
"ri_bitbytes=%u "
822822
"start=%u len=%u offset=%u\n",
823823
(unsigned long long)rgd->rd_addr,
824824
rgd->rd_length,

fs/gfs2/util.c

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -376,8 +376,8 @@ void gfs2_assert_withdraw_i(struct gfs2_sbd *sdp, char *assertion,
376376
return;
377377

378378
fs_err(sdp,
379-
"fatal: assertion \"%s\" failed\n"
380-
" function = %s, file = %s, line = %u\n",
379+
"fatal: assertion \"%s\" failed - "
380+
"function = %s, file = %s, line = %u\n",
381381
assertion, function, file, line);
382382

383383
/*
@@ -407,7 +407,8 @@ void gfs2_assert_warn_i(struct gfs2_sbd *sdp, char *assertion,
407407
return;
408408

409409
if (sdp->sd_args.ar_errors == GFS2_ERRORS_WITHDRAW)
410-
fs_warn(sdp, "warning: assertion \"%s\" failed at function = %s, file = %s, line = %u\n",
410+
fs_warn(sdp, "warning: assertion \"%s\" failed - "
411+
"function = %s, file = %s, line = %u\n",
411412
assertion, function, file, line);
412413

413414
if (sdp->sd_args.ar_debug)
@@ -416,10 +417,10 @@ void gfs2_assert_warn_i(struct gfs2_sbd *sdp, char *assertion,
416417
dump_stack();
417418

418419
if (sdp->sd_args.ar_errors == GFS2_ERRORS_PANIC)
419-
panic("GFS2: fsid=%s: warning: assertion \"%s\" failed\n"
420-
"GFS2: fsid=%s: function = %s, file = %s, line = %u\n",
420+
panic("GFS2: fsid=%s: warning: assertion \"%s\" failed - "
421+
"function = %s, file = %s, line = %u\n",
421422
sdp->sd_fsname, assertion,
422-
sdp->sd_fsname, function, file, line);
423+
function, file, line);
423424

424425
sdp->sd_last_warning = jiffies;
425426
}
@@ -432,7 +433,8 @@ void gfs2_consist_i(struct gfs2_sbd *sdp, const char *function,
432433
char *file, unsigned int line)
433434
{
434435
gfs2_lm(sdp,
435-
"fatal: filesystem consistency error - function = %s, file = %s, line = %u\n",
436+
"fatal: filesystem consistency error - "
437+
"function = %s, file = %s, line = %u\n",
436438
function, file, line);
437439
gfs2_withdraw(sdp);
438440
}
@@ -447,9 +449,9 @@ void gfs2_consist_inode_i(struct gfs2_inode *ip,
447449
struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode);
448450

449451
gfs2_lm(sdp,
450-
"fatal: filesystem consistency error\n"
451-
" inode = %llu %llu\n"
452-
" function = %s, file = %s, line = %u\n",
452+
"fatal: filesystem consistency error - "
453+
"inode = %llu %llu, "
454+
"function = %s, file = %s, line = %u\n",
453455
(unsigned long long)ip->i_no_formal_ino,
454456
(unsigned long long)ip->i_no_addr,
455457
function, file, line);
@@ -470,9 +472,9 @@ void gfs2_consist_rgrpd_i(struct gfs2_rgrpd *rgd,
470472
sprintf(fs_id_buf, "fsid=%s: ", sdp->sd_fsname);
471473
gfs2_rgrp_dump(NULL, rgd, fs_id_buf);
472474
gfs2_lm(sdp,
473-
"fatal: filesystem consistency error\n"
474-
" RG = %llu\n"
475-
" function = %s, file = %s, line = %u\n",
475+
"fatal: filesystem consistency error - "
476+
"RG = %llu, "
477+
"function = %s, file = %s, line = %u\n",
476478
(unsigned long long)rgd->rd_addr,
477479
function, file, line);
478480
gfs2_dump_glock(NULL, rgd->rd_gl, 1);
@@ -492,9 +494,9 @@ int gfs2_meta_check_ii(struct gfs2_sbd *sdp, struct buffer_head *bh,
492494
int me;
493495

494496
gfs2_lm(sdp,
495-
"fatal: invalid metadata block\n"
496-
" bh = %llu (%s)\n"
497-
" function = %s, file = %s, line = %u\n",
497+
"fatal: invalid metadata block - "
498+
"bh = %llu (%s), "
499+
"function = %s, file = %s, line = %u\n",
498500
(unsigned long long)bh->b_blocknr, type,
499501
function, file, line);
500502
me = gfs2_withdraw(sdp);
@@ -514,9 +516,9 @@ int gfs2_metatype_check_ii(struct gfs2_sbd *sdp, struct buffer_head *bh,
514516
int me;
515517

516518
gfs2_lm(sdp,
517-
"fatal: invalid metadata block\n"
518-
" bh = %llu (type: exp=%u, found=%u)\n"
519-
" function = %s, file = %s, line = %u\n",
519+
"fatal: invalid metadata block - "
520+
"bh = %llu (type: exp=%u, found=%u), "
521+
"function = %s, file = %s, line = %u\n",
520522
(unsigned long long)bh->b_blocknr, type, t,
521523
function, file, line);
522524
me = gfs2_withdraw(sdp);
@@ -533,8 +535,8 @@ int gfs2_io_error_i(struct gfs2_sbd *sdp, const char *function, char *file,
533535
unsigned int line)
534536
{
535537
gfs2_lm(sdp,
536-
"fatal: I/O error\n"
537-
" function = %s, file = %s, line = %u\n",
538+
"fatal: I/O error - "
539+
"function = %s, file = %s, line = %u\n",
538540
function, file, line);
539541
return gfs2_withdraw(sdp);
540542
}
@@ -551,9 +553,9 @@ void gfs2_io_error_bh_i(struct gfs2_sbd *sdp, struct buffer_head *bh,
551553
if (gfs2_withdrawing_or_withdrawn(sdp))
552554
return;
553555

554-
fs_err(sdp, "fatal: I/O error\n"
555-
" block = %llu\n"
556-
" function = %s, file = %s, line = %u\n",
556+
fs_err(sdp, "fatal: I/O error - "
557+
"block = %llu, "
558+
"function = %s, file = %s, line = %u\n",
557559
(unsigned long long)bh->b_blocknr, function, file, line);
558560
if (withdraw)
559561
gfs2_withdraw(sdp);

0 commit comments

Comments
 (0)