Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1047047ybv; Fri, 7 Feb 2020 13:22:42 -0800 (PST) X-Google-Smtp-Source: APXvYqy4Hw1lusKsMRfT+uudZlX6N8dTmvboTTwtqYQ102Cbj3CUcSFYQeSWAcI0BYDN/ZsEkiBO X-Received: by 2002:aca:e106:: with SMTP id y6mr3498457oig.131.1581110561906; Fri, 07 Feb 2020 13:22:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581110561; cv=none; d=google.com; s=arc-20160816; b=R865vwTzhJaP9IiQ84R0lxSFuJeV2Qy0TSdeQZp5MvrFZorVsBL/xLgEdVjN1iuq0y Zw0VD4lbCU7/C+3YR9AEty43tWkoNgMTpt2eiCYYmNzOS9J4/U9pGhNsb5p07PVu0y68 dN18ZNV9AOy8q0utc30No9WTCju9Dfdvp4uRvxs/l8oZX8AXpVv6n4vnWZKsJMAEhFm6 Wv3qdQoFJIbwyPIWhfA8jVSMTInifFgfQLue2b5YLBgigvRgFe7fpc5nF4Zi1evGbpXr 6K2b9DMe+MtUP4ruPUrnIHs51PfbxmjcUeibxrrr/WbhqK6r6xyNGBS1dBrjHG7rxz6u cLfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature:dkim-signature; bh=ophMmMwMLLaKjOJP0ctw12O67B1zRQvfdgS0jTuIqR8=; b=ZuG45hFnOnFTn/PXkf2gzsJ4tecPMMsRWXtHgmCeiB0C1mPS3GNPjkZVT32dm8PNP4 xk2vahQrWR22NRfwfxT7KRT82FlQ1zAx7X08ognrNj6bSi31tN9aXcH5coPFzP2u+3kw EMdcR1y81fUTDlYa+P0tdb4e32lJWAnLhq9EaGoGkvBVgOGG2FNKK+3kfs+oF+mdqxa5 TIlCyYnL1R/whswx/q4IPJRDlQG15EB8qVl5CMD6L+rVVVXQYfT+0clqm2nZl1dtjpXi bKXn7Nl3hxqQXDpEvSdV6b5Na4tmrzau5/zEyKRmvbrM3zo6grJvQwCmy5rz7RZtTVMu 6dmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@anarazel.de header.s=fm3 header.b=KMEycsMB; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=aIESVf2X; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l21si4632017oic.126.2020.02.07.13.22.29; Fri, 07 Feb 2020 13:22:41 -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=@anarazel.de header.s=fm3 header.b=KMEycsMB; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=aIESVf2X; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727379AbgBGVUR (ORCPT + 99 others); Fri, 7 Feb 2020 16:20:17 -0500 Received: from new4-smtp.messagingengine.com ([66.111.4.230]:33617 "EHLO new4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726947AbgBGVUR (ORCPT ); Fri, 7 Feb 2020 16:20:17 -0500 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailnew.nyi.internal (Postfix) with ESMTP id 76A4A6E35; Fri, 7 Feb 2020 16:20:16 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Fri, 07 Feb 2020 16:20:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm3; bh=ophMmMwMLLaKjOJP0ctw12O67B1 zRQvfdgS0jTuIqR8=; b=KMEycsMBR2DnW931V6xgvAiSmfOPGSb/NzAgL/pUhV6 5Wyq45jpDjzVcopHjYYbqZijtAuNRMfgYIQi7LiqW/O/iQfZQ1tGF7fzmQhKLSTq BmwiHEUOycWjA1B1zkY+lAhcNja0B3sFoFAvuu8sjlDsfnND+cZxqXWEqS2JDtsn uflCLJhpFozpBlwWjUB66JvFSpQGAh2jAnursgJ5o1tDHAvMDlexrbjw2LWuvZ8M 0vQ1L31ji3aAqt8+SKKzihxOpwahDPVPWE55oAi7xrkKiDFgwDmnIeAmQJydYVBA ITkZJBNpxvWVIBhNLXsm62+sAaKQghNrsnXJGcWBocw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=ophMmM wMLLaKjOJP0ctw12O67B1zRQvfdgS0jTuIqR8=; b=aIESVf2XQNaAvI8kV/eGNj DpIOgPq2aDuAYiRubi/463C7rfC2j0eCrDe8JqsjUiigi1YRevlnGYQuuh8VvL0j PrT/lH9WY/B6UcIPN+rrCdkHCzdLhFW7WlZceoCfW9pTb7bzt9ZNbiD+MY0MPf7m 5ruYOpscaPr67hXGgOeYmrBbGttGed/VWhvoejqbEgCwLR33xvqDje7DuMLmRcRh 2JfrO6PdYFwe9iYRy4SreANfcCDpOAkkrbEtJxTf4LS/jXreYB9VblH92sjsLNJn 0MXqEkK5LsK6HSg9A3dcK5HAs7FmJiEOBiBKkXTmJIOiF/Y8JFOPVG1KwFTzLVaA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrheehgddugeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehttdertddttddvnecuhfhrohhmpeetnhgurhgv shcuhfhrvghunhguuceorghnughrvghssegrnhgrrhgriigvlhdruggvqeenucfkphepie ejrdduiedtrddvudejrddvhedtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghm pehmrghilhhfrhhomheprghnughrvghssegrnhgrrhgriigvlhdruggv X-ME-Proxy: Received: from intern.anarazel.de (c-67-160-217-250.hsd1.ca.comcast.net [67.160.217.250]) by mail.messagingengine.com (Postfix) with ESMTPA id C1C1A3060272; Fri, 7 Feb 2020 16:20:13 -0500 (EST) Date: Fri, 7 Feb 2020 13:20:12 -0800 From: Andres Freund To: Dave Chinner Cc: Jeff Layton , viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, willy@infradead.org, dhowells@redhat.com, hch@infradead.org, jack@suse.cz, akpm@linux-foundation.org Subject: Re: [PATCH v3 0/3] vfs: have syncfs() return error when there are writeback errors Message-ID: <20200207212012.7jrivg2bvuvvful5@alap3.anarazel.de> References: <20200207170423.377931-1-jlayton@kernel.org> <20200207205243.GP20628@dread.disaster.area> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200207205243.GP20628@dread.disaster.area> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 2020-02-08 07:52:43 +1100, Dave Chinner wrote: > On Fri, Feb 07, 2020 at 12:04:20PM -0500, Jeff Layton wrote: > > You're probably wondering -- Where are v1 and v2 sets? > > The basic idea is to track writeback errors at the superblock level, > > so that we can quickly and easily check whether something bad happened > > without having to fsync each file individually. syncfs is then changed > > to reliably report writeback errors, and a new ioctl is added to allow > > userland to get at the current errseq_t value w/o having to sync out > > anything. > > So what, exactly, can userspace do with this error? It has no idea > at all what file the writeback failure occurred on or even > what files syncfs() even acted on so there's no obvious error > recovery that it could perform on reception of such an error. Depends on the application. For e.g. postgres it'd to be to reset in-memory contents and perform WAL replay from the last checkpoint. Due to various reasons* it's very hard for us (without major performance and/or reliability impact) to fully guarantee that by the time we fsync specific files we do so on an old enough fd to guarantee that we'd see the an error triggered by background writeback. But keeping track of all potential filesystems data resides on (with one fd open permanently for each) and then syncfs()ing them at checkpoint time is quite doable. *I can go into details, but it's probably not interesting enough > > - This adds a new generic fs ioctl to allow userland to scrape the > > current superblock's errseq_t value. It may be best to present this > > to userland via fsinfo() instead (once that's merged). I'm fine with > > dropping the last patch for now and reworking it for fsinfo if so. > > What, exactly, is this useful for? Why would we consider exposing > an internal implementation detail to userspace like this? There is, as far as I can tell, so far no way but scraping the kernel log to figure out if there have been data loss errors on a machine/fs. Even besides app specific reactions like outlined above, just generally being able to alert whenever there error count increases seems extremely useful. I'm not sure it makes sense to expose the errseq_t bits straight though - seems like it'd enshrine them in userspace ABI too much? Greetings, Andres Freund