diff options
author | Eric Sandeen <sandeen@redhat.com> | 2013-01-30 19:54:55 -0500 |
---|---|---|
committer | Josef Bacik <jbacik@fusionio.com> | 2013-02-20 12:59:18 -0500 |
commit | aa43a17c21cf35329b1a495dd6876798dd8b016b (patch) | |
tree | d958b6d58305a2ea121613e8e89cd52ccfdbf513 /fs/btrfs/super.c | |
parent | 5a01604783c23f28bd4212e839e79277193f974f (diff) |
btrfs: handle null fs_info in btrfs_panic()
At least backref_tree_panic() can apparently pass
in a null fs_info, so handle that in __btrfs_panic
to get the message out on the console.
The btrfs_panic macro also uses fs_info, but that's
largely pointless; it's testing to see if
BTRFS_MOUNT_PANIC_ON_FATAL_ERROR is not set.
But if it *were* set, __btrfs_panic() would have,
well, paniced and we wouldn't be here, testing it!
So just BUG() at this point.
And since we only use fs_info once now, just use it
directly.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Diffstat (limited to 'fs/btrfs/super.c')
-rw-r--r-- | fs/btrfs/super.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index fd6a07c30ee9..06537d217419 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c | |||
@@ -289,7 +289,7 @@ void __btrfs_panic(struct btrfs_fs_info *fs_info, const char *function, | |||
289 | vaf.va = &args; | 289 | vaf.va = &args; |
290 | 290 | ||
291 | errstr = btrfs_decode_error(errno, nbuf); | 291 | errstr = btrfs_decode_error(errno, nbuf); |
292 | if (fs_info->mount_opt & BTRFS_MOUNT_PANIC_ON_FATAL_ERROR) | 292 | if (fs_info && (fs_info->mount_opt & BTRFS_MOUNT_PANIC_ON_FATAL_ERROR)) |
293 | panic(KERN_CRIT "BTRFS panic (device %s) in %s:%d: %pV (%s)\n", | 293 | panic(KERN_CRIT "BTRFS panic (device %s) in %s:%d: %pV (%s)\n", |
294 | s_id, function, line, &vaf, errstr); | 294 | s_id, function, line, &vaf, errstr); |
295 | 295 | ||