Skip to contentSkip to conversation

Btrfs: convert printk to btrfs_ and fix BTRFS prefix

DISCUSSION Dan Carpenter 1 participant 1 message Jan 9, 2014 Btrfs file system

lore
Share & tools
lore
#0 lore raw

Hello Frank Holton,

This is a semi-automatic email about new static checker warnings.

The patch f2ee0bf65a1c: "Btrfs: convert printk to btrfs_ and fix BTRFS prefix" from Dec 20, 2013, leads to the following Smatch complaint:

fs/btrfs/super.c:298 __btrfs_panic()
error: we previously assumed 'fs_info' could be null (see line 294)

fs/btrfs/super.c
293 errstr = btrfs_decode_error(errno);
294 if (fs_info && (fs_info->mount_opt & BTRFS_MOUNT_PANIC_ON_FATAL_ERROR))

                    ^^^^^^^

Existing check.

295 panic(KERN_CRIT "BTRFS panic (device %s) in %s:%d: %pV (errno=%d %s)\n",
296 s_id, function, line, &vaf, errno, errstr);
297
298 btrfs_crit(fs_info, "panic in %s:%d: %pV (errno=%d %s)",

                           ^^^^^^^

Patch introduces new unchecked dereference inside btrfs_crit().

   299			   function, line, &vaf, errno, errstr);
   300		va_end(args);

regards,
dan carpenter