aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/super.c
diff options
context:
space:
mode:
authorSimon Kirby <sim@hostway.ca>2013-03-19 18:41:23 -0400
committerJosef Bacik <jbacik@fusionio.com>2013-05-06 15:54:23 -0400
commitc2cf52eb71aeb902682e0c1fa29e4e9e4a7f4ffc (patch)
tree6c62e02e87bc92eb8eb66bf4c0fbebc00b64a1e5 /fs/btrfs/super.c
parentaa8259145ecb8d432685c1167a194094559647a1 (diff)
Btrfs: Include the device in most error printk()s
With more than one btrfs volume mounted, it can be very difficult to find out which volume is hitting an error. btrfs_error() will print this, but it is currently rigged as more of a fatal error handler, while many of the printk()s are currently for debugging and yet-unhandled cases. This patch just changes the functions where the device information is already available. Some cases remain where the root or fs_info is not passed to the function emitting the error. This may introduce some confusion with volumes backed by multiple devices emitting errors referring to the primary device in the set instead of the one on which the error occurred. Use btrfs_printk(fs_info, format, ...) rather than writing the device string every time, and introduce macro wrappers ala XFS for brevity. Since the function already cannot be used for continuations, print a newline as part of the btrfs_printk() message rather than at each caller. Signed-off-by: Simon Kirby <sim@hostway.ca> Reviewed-by: David Sterba <dsterba@suse.cz> Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Diffstat (limited to 'fs/btrfs/super.c')
-rw-r--r--fs/btrfs/super.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index 7f00a91ccc10..3fd4f2c3d529 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -105,7 +105,7 @@ static void btrfs_handle_error(struct btrfs_fs_info *fs_info)
105 105
106 if (test_bit(BTRFS_FS_STATE_ERROR, &fs_info->fs_state)) { 106 if (test_bit(BTRFS_FS_STATE_ERROR, &fs_info->fs_state)) {
107 sb->s_flags |= MS_RDONLY; 107 sb->s_flags |= MS_RDONLY;
108 printk(KERN_INFO "btrfs is forced readonly\n"); 108 btrfs_info(fs_info, "forced readonly");
109 /* 109 /*
110 * Note that a running device replace operation is not 110 * Note that a running device replace operation is not
111 * canceled here although there is no way to update 111 * canceled here although there is no way to update
@@ -172,7 +172,7 @@ static const char * const logtypes[] = {
172 "debug", 172 "debug",
173}; 173};
174 174
175void btrfs_printk(struct btrfs_fs_info *fs_info, const char *fmt, ...) 175void btrfs_printk(const struct btrfs_fs_info *fs_info, const char *fmt, ...)
176{ 176{
177 struct super_block *sb = fs_info->sb; 177 struct super_block *sb = fs_info->sb;
178 char lvl[4]; 178 char lvl[4];
@@ -196,7 +196,7 @@ void btrfs_printk(struct btrfs_fs_info *fs_info, const char *fmt, ...)
196 vaf.fmt = fmt; 196 vaf.fmt = fmt;
197 vaf.va = &args; 197 vaf.va = &args;
198 198
199 printk("%sBTRFS %s (device %s): %pV", lvl, type, sb->s_id, &vaf); 199 printk("%sBTRFS %s (device %s): %pV\n", lvl, type, sb->s_id, &vaf);
200 200
201 va_end(args); 201 va_end(args);
202} 202}
@@ -255,9 +255,9 @@ void __btrfs_abort_transaction(struct btrfs_trans_handle *trans,
255 const char *errstr; 255 const char *errstr;
256 256
257 errstr = btrfs_decode_error(errno); 257 errstr = btrfs_decode_error(errno);
258 btrfs_printk(root->fs_info, 258 btrfs_warn(root->fs_info,
259 "%s:%d: Aborting unused transaction (%s)\n", 259 "%s:%d: Aborting unused transaction(%s).",
260 function, line, errstr); 260 function, line, errstr);
261 return; 261 return;
262 } 262 }
263 ACCESS_ONCE(trans->transaction->aborted) = errno; 263 ACCESS_ONCE(trans->transaction->aborted) = errno;