From patchwork Fri Mar 31 19:26:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 9657205 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 14F4B60350 for ; Fri, 31 Mar 2017 19:27:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 088412817F for ; Fri, 31 Mar 2017 19:27:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F16BB2860D; Fri, 31 Mar 2017 19:27:14 +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 autolearn=unavailable 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 A0F342817F for ; Fri, 31 Mar 2017 19:27:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755594AbdCaT0R (ORCPT ); Fri, 31 Mar 2017 15:26:17 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53356 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755532AbdCaT0N (ORCPT ); Fri, 31 Mar 2017 15:26:13 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7EE4C8AE72; Fri, 31 Mar 2017 19:26:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 7EE4C8AE72 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jlayton@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 7EE4C8AE72 Received: from ceres.poochiereds.net (ovpn-124-59.rdu2.redhat.com [10.10.124.59]) by smtp.corp.redhat.com (Postfix) with ESMTP id C214017F24; Fri, 31 Mar 2017 19:26:06 +0000 (UTC) From: Jeff Layton To: linux-fsdevel@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-ext4@vger.kernel.org, akpm@linux-foundation.org, tytso@mit.edu, jack@suse.cz, willy@infradead.org, neilb@suse.com Subject: [RFC PATCH 3/4] buffer: set wb errors using both new and old infrastructure for now Date: Fri, 31 Mar 2017 15:26:02 -0400 Message-Id: <20170331192603.16442-4-jlayton@redhat.com> In-Reply-To: <20170331192603.16442-1-jlayton@redhat.com> References: <20170331192603.16442-1-jlayton@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Fri, 31 Mar 2017 19:26:07 +0000 (UTC) Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In later patches, we'll be converting filesystems over to use the new filemap_*_wb_error API for storing and reporting writeback errors. Since several different filesystems use the code in buffer.c, ensure that we report errors using both schemes for now. Eventually we should be able to remove the mapping_set_error calls once nothing relies on it. Signed-off-by: Jeff Layton --- fs/buffer.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fs/buffer.c b/fs/buffer.c index 9196f2a270da..5dde6de2408f 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -354,6 +354,7 @@ void end_buffer_async_write(struct buffer_head *bh, int uptodate) } else { buffer_io_error(bh, ", lost async page write"); mapping_set_error(page->mapping, -EIO); + filemap_set_wb_error(page->mapping, -EIO); set_buffer_write_io_error(bh); clear_buffer_uptodate(bh); SetPageError(page); @@ -1879,6 +1880,7 @@ int __block_write_full_page(struct inode *inode, struct page *page, SetPageError(page); BUG_ON(PageWriteback(page)); mapping_set_error(page->mapping, err); + filemap_set_wb_error(page->mapping, err); set_page_writeback(page); do { struct buffer_head *next = bh->b_this_page; @@ -3291,8 +3293,10 @@ drop_buffers(struct page *page, struct buffer_head **buffers_to_free) bh = head; do { - if (buffer_write_io_error(bh) && page->mapping) + if (buffer_write_io_error(bh) && page->mapping) { mapping_set_error(page->mapping, -EIO); + filemap_set_wb_error(page->mapping, -EIO); + } if (buffer_busy(bh)) goto failed; bh = bh->b_this_page;