]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
Btrfs: don't WARN() in btrfs_transaction_abort() for IO errors
authorChris Mason <clm@fb.com>
Fri, 9 Dec 2016 13:56:33 +0000 (05:56 -0800)
committerChris Mason <clm@fb.com>
Fri, 9 Dec 2016 14:00:28 +0000 (06:00 -0800)
btrfs_transaction_abort() has a WARN() to help us nail down whatever
problem lead to the abort.  But most of the time, we're aborting for EIO,
and the warning just adds noise.

Signed-off-by: Chris Mason <clm@fb.com>
fs/btrfs/ctree.h

index fc1864acb3682802de78d87cd2589387e8331205..50bcfb80d33a012e0b0dc0daa6fe1aeb03d5b2cd 100644 (file)
@@ -3445,9 +3445,14 @@ do {                                                             \
        /* Report first abort since mount */                    \
        if (!test_and_set_bit(BTRFS_FS_STATE_TRANS_ABORTED,     \
                        &((trans)->fs_info->fs_state))) {       \
-               WARN(1, KERN_DEBUG                              \
-               "BTRFS: Transaction aborted (error %d)\n",      \
-               (errno));                                       \
+               if ((errno) != -EIO) {                          \
+                       WARN(1, KERN_DEBUG                              \
+                       "BTRFS: Transaction aborted (error %d)\n",      \
+                       (errno));                                       \
+               } else {                                                \
+                       pr_debug("BTRFS: Transaction aborted (error %d)\n", \
+                                 (errno));                     \
+               }                                               \
        }                                                       \
        __btrfs_abort_transaction((trans), __func__,            \
                                  __LINE__, (errno));           \