Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp820675ybv; Fri, 7 Feb 2020 09:06:22 -0800 (PST) X-Google-Smtp-Source: APXvYqwj4CLCm7uCvWx3HSlpVDXLl2vkpVVnQfohe8UXbD7yH7PWWXr4GJo+uvc5c/7WOFqg+DKB X-Received: by 2002:aca:be56:: with SMTP id o83mr2774471oif.25.1581095181820; Fri, 07 Feb 2020 09:06:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581095181; cv=none; d=google.com; s=arc-20160816; b=RvmoHsNTP+PUWWLpH9Pe92rl4cm4+lLB8RCccyhXXItQpbERVHEXDQ67a4EY6HK4Bh Y0CzxkHNJvqud65lMJale+Jk3Q6VnJV1dOJdZdNLEkC/cy7FF9x9ynel8uj3IGxHEzZb DT+3nKvNEutBJFSAnpzgSs/TV0uAqj0w8naprgB2N1oJ7wb0W6gTWdye7i+LgzJnHJvf Fo8Dmky3PXQvWYzi0VC+qNjf9ycpx912FyUWAUbwgG/L0RlGgYn/9gO0jXCld4fEWzOD L/Fwj0tFKI2xV+S0thbRmbG1vs3C4fycQLH5vJ55hBaLlTFl1k9hXl4uYpwJh7R2oZ/v R8WQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=dbtEedozgdVBr+ySxtBXJ0S3njR2G2Czo7hNUJem/Tk=; b=diHJXDIC3HJjcWHiPBWVTINkmIudQDsk91jiXDlZPK/Vp8Jnvuwf4f8/+KSfFPoHSZ CIu7RQcXh2NtDEpgPHBgggU8ZlcWqZd06UG0fJT0BvD/QTotRny2flf5QWAp5u/xUPKZ 0Rmzp/Ey3dNvZPmIVcq9rjVoBM5CIRGG3w+PEjAjkOMhFPggfXTg4LwIv6AlJ7tA8ZVf u2ld5cRmEPfbm95coHc4rmCI7PyzY4+7nRHOiXNbxj+16NLF5AtjENA5JM+R3uagIfHw kYoywXUOpU0JkZIQ66rDffBOIuWPEXSl8VaxgC4eQN96PNkcolsQpemT07dF/31TTgQ1 YLjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ixqV4Vj9; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t11si4524466oih.187.2020.02.07.09.06.09; Fri, 07 Feb 2020 09:06:21 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ixqV4Vj9; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727516AbgBGREi (ORCPT + 99 others); Fri, 7 Feb 2020 12:04:38 -0500 Received: from mail.kernel.org ([198.145.29.99]:52942 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727309AbgBGRE2 (ORCPT ); Fri, 7 Feb 2020 12:04:28 -0500 Received: from tleilax.poochiereds.net (68-20-15-154.lightspeed.rlghnc.sbcglobal.net [68.20.15.154]) (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 5837721775; Fri, 7 Feb 2020 17:04:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581095068; bh=ZxvKRMhl7lIThcnne9emlNMv0Ks2BQRDLcIh5ixelek=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ixqV4Vj9ZtMDKL2uwwsmYIuCMMTiJgzkyW3Q5SIfbS/E5WdnX4Hl2Ug5YTxXQwf4M syoAt6TqtpBQGciunxTzImNBlzlGoqs2yuBF2+HQ/Wrrox2J3uZ9JyrGIQr5hzhh3v P2Mb9CuDd3I/2h/didpKn+nf0d+XHtK5eJv2ECkE= From: Jeff Layton To: viro@zeniv.linux.org.uk Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, andres@anarazel.de, willy@infradead.org, dhowells@redhat.com, hch@infradead.org, jack@suse.cz, akpm@linux-foundation.org Subject: [PATCH v3 2/3] buffer: record blockdev write errors in super_block that it backs Date: Fri, 7 Feb 2020 12:04:22 -0500 Message-Id: <20200207170423.377931-3-jlayton@kernel.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200207170423.377931-1-jlayton@kernel.org> References: <20200207170423.377931-1-jlayton@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jeff Layton When syncing out a block device (a'la __sync_blockdev), any error encountered will only be recorded in the bd_inode's mapping. When the blockdev contains a filesystem however, we'd like to also record the error in the super_block that's stored there. Make mark_buffer_write_io_error also record the error in the corresponding super_block when a writeback error occurs and the block device contains a mounted superblock. Signed-off-by: Jeff Layton --- fs/buffer.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/buffer.c b/fs/buffer.c index b8d28370cfd7..451f1be6e1a4 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -1166,6 +1166,8 @@ void mark_buffer_write_io_error(struct buffer_head *bh) mapping_set_error(bh->b_page->mapping, -EIO); if (bh->b_assoc_map) mapping_set_error(bh->b_assoc_map, -EIO); + if (bh->b_bdev->bd_super) + errseq_set(&bh->b_bdev->bd_super->s_wb_err, -EIO); } EXPORT_SYMBOL(mark_buffer_write_io_error); -- 2.24.1