From patchwork Mon Dec 19 20:09:46 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Mahoney X-Patchwork-Id: 9480697 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B4FC8601C0 for ; Mon, 19 Dec 2016 20:09:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A09B328471 for ; Mon, 19 Dec 2016 20:09:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 92775284E1; Mon, 19 Dec 2016 20:09:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_TVD_MIME_EPI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 21F9F28471 for ; Mon, 19 Dec 2016 20:09:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751914AbcLSUJx (ORCPT ); Mon, 19 Dec 2016 15:09:53 -0500 Received: from mx2.suse.de ([195.135.220.15]:47682 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751180AbcLSUJv (ORCPT ); Mon, 19 Dec 2016 15:09:51 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id B5412ABB4; Mon, 19 Dec 2016 20:09:49 +0000 (UTC) To: Chris Mason , David Sterba , linux-btrfs From: Jeff Mahoney Subject: Re: Btrfs: don't WARN() in btrfs_transaction_abort() for IO errors Message-ID: <2b857413-77b2-56c3-4748-786ae2c3ea14@suse.com> Date: Mon, 19 Dec 2016 15:09:46 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:50.0) Gecko/20100101 Thunderbird/50.0 MIME-Version: 1.0 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP commit e5d6b12fe14e89ea1c494585c47b1dfb31d71183 Author: Chris Mason Date: Fri Dec 9 05:56:33 2016 -0800 Btrfs: don't WARN() in btrfs_transaction_abort() for IO errors 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 Can we use btrfs_debug here instead? There are a few naked pr_* calls left but most of them are either continuing prior lines or don't have an fsinfo available. Thanks, -Jeff diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index fc1864a..50bcfb8 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h @@ -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)); \