From patchwork Fri May 18 12:34:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 10410371 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 8C138601F9 for ; Fri, 18 May 2018 12:35:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7C2C128936 for ; Fri, 18 May 2018 12:35:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 70F8328956; Fri, 18 May 2018 12:35:54 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 1D1DD28936 for ; Fri, 18 May 2018 12:35:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752406AbeERMfv (ORCPT ); Fri, 18 May 2018 08:35:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:39534 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751995AbeERMeY (ORCPT ); Fri, 18 May 2018 08:34:24 -0400 Received: from tleilax.poochiereds.net (cpe-71-70-156-158.nc.res.rr.com [71.70.156.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F3B6520861; Fri, 18 May 2018 12:34:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1526646863; bh=OCMDk1B/jmhVwlU/srRUt7qrdo4wQiDJzkoOXp02M0s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bmZC863nqV16nXHqj8cWpoJGf6CTwmy968jrUTLEE55W+Gk0xfkMu6gECwPTijqrE L9z+r+GEWR0KdrZFpAcA3EWi8eu27OQH3oOO3n6ijayWKIvpS9MRfvxYzxIgjMLyoe eY/kTLtzBYZZzLjKxtvEP/l39c7QcbeUzkVgdfhw= From: Jeff Layton To: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: viro@ZenIV.linux.org.uk, willy@infradead.org, andres@anarazel.de Subject: [RFC PATCH 07/11] ext4: have sync_fs op report writeback errors when passed a since pointer Date: Fri, 18 May 2018 08:34:11 -0400 Message-Id: <20180518123415.28181-8-jlayton@kernel.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180518123415.28181-1-jlayton@kernel.org> References: <20180518123415.28181-1-jlayton@kernel.org> 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 From: Jeff Layton When ext4_sync_fs gets a non-NULL since pointer, use it to report errors vs. the errseq_t in the super_block. This allows us to properly report an error to sync_fs when any inode has failed writeback since we last checked for it. Signed-off-by: Jeff Layton --- fs/ext4/super.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 896ddf8c3421..a5f41d31611f 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -4898,6 +4898,8 @@ static int ext4_sync_fs(struct super_block *sb, int wait, errseq_t *since) } out: ret2 = __sync_blockdev(sb->s_bdev, wait); + if (since) + ret2 = errseq_check_and_advance(&sb->s_wb_err, since); return ret ? ret : ret2; }