From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-it0-f52.google.com ([209.85.214.52]:54054 "EHLO mail-it0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750939AbeEUShC (ORCPT ); Mon, 21 May 2018 14:37:02 -0400 Received: by mail-it0-f52.google.com with SMTP id n64-v6so22186299itb.3 for ; Mon, 21 May 2018 11:37:01 -0700 (PDT) Subject: Re: [PATCH RESEND] loop: clear wb_err in bd_inode when detaching backing file To: Jeff Layton Cc: linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org, willy@infradead.org, darrick.wong@oracle.com, tytso@mit.edu, bfoster@redhat.com References: <20180521183503.6029-1-jlayton@kernel.org> From: Jens Axboe Message-ID: Date: Mon, 21 May 2018 12:36:59 -0600 MIME-Version: 1.0 In-Reply-To: <20180521183503.6029-1-jlayton@kernel.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On 5/21/18 12:35 PM, Jeff Layton wrote: > From: Jeff Layton > > When a loop block device encounters a writeback error, that error will > get propagated to the bd_inode's wb_err field. If we then detach the > backing file from it, attach another and fsync it, we'll get back the > writeback error that we had from the previous backing file. > > This is a bit of a grey area as POSIX doesn't cover loop devices, but it > is somewhat counterintuitive. > > If we detach a backing file from the loopdev while there are still > unreported errors, take it as a sign that we're no longer interested in > the previous file, and clear out the wb_err in the loop blockdev. Applied, thanks Jeff. -- Jens Axboe