Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2336248imj; Mon, 11 Feb 2019 00:43:38 -0800 (PST) X-Google-Smtp-Source: AHgI3IY4ISHeqldbFEp8L4ABkX8XyKTJ+4FvwepoUTp7xilXghgUdpuzoeVtuuBM/6JKZj5zyDsi X-Received: by 2002:a63:e21:: with SMTP id d33mr18610907pgl.272.1549874618130; Mon, 11 Feb 2019 00:43:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549874618; cv=none; d=google.com; s=arc-20160816; b=ZhXdls80E4JLqz83XrVwWTHdxlSRMqX6VT04uNGsGmMJGnZY6UM67KwnfSR+mQkH14 P+AovCenIUjjBiAYmqQVpltAFTZLnnXOjqowlpN6vttS8CDBxRgBWuZh2AwLGtFLUPaX 6inybPPZRtURrEUOINtKe5JGMVhJmta2HsexgE0b7i/okIhFBNJaC1CZPWCaQyQfUMG+ ieDq3XHAIuJzwScZbsPv90fKuEVzzwcEofR0kWjn+lAHbu5R+Hg6uq3nwVj+1lt/u24a S9rZ7dATUi11SF24RQju2RBE9EiDA64AFHIyRcRoxr2FxivMnzRbKX1UZzJpLaKLwjCj BowA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=0+LiEOpQTPiEIHMUbkwjHqKowpjdME4EJoMV5iV09Ak=; b=kvDqNQsbUZ15ZrsNhvE7UesiJNJSxVxFHPbkky1nBNjLqu4pQwrWuY1cpR/8GvQTto OJXYktCK4wCNOd6R63prQ1sMnRJKl7ePikf1SUIO+aYP8lJPtYy/LrO561kSIZnxyDK4 LE8oQeGSKheYgZHlZ7Ee4/T3aRjcQXT0celG8oCdycGCS+FwCfSfh7SCFEO5HDE2fi6h 4AbEbpv4AnVk5P99KnANghqPhP6wB504vUwTQa7CPMMLwhZqhDSUXnlICuMz5OEoVj5k KOQny11vn0w1SRqwHyXcg93geuT1l2gZHA/qMwA6/AqmdfkRLqWauk6kz1COo5Gef7lf BXsg== ARC-Authentication-Results: i=1; mx.google.com; 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 l7si9185637pgk.169.2019.02.11.00.43.22; Mon, 11 Feb 2019 00:43:38 -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; 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 S1727209AbfBKIm1 (ORCPT + 99 others); Mon, 11 Feb 2019 03:42:27 -0500 Received: from mx2.suse.de ([195.135.220.15]:42834 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727074AbfBKIm0 (ORCPT ); Mon, 11 Feb 2019 03:42:26 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id C83D6ACB8; Mon, 11 Feb 2019 08:42:25 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 6A6211E09A8; Mon, 11 Feb 2019 09:42:25 +0100 (CET) Date: Mon, 11 Feb 2019 09:42:25 +0100 From: Jan Kara To: Steve Magnani Cc: jack@suse.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH 0/2] udf: Fix corrupt on-disk integrity descriptor following sync() Message-ID: <20190211084225.GB19029@quack2.suse.cz> References: <20190208173455.20151-1-steve@digidescorp.com> <7ce9c657-efba-5dbb-441d-acb00a13044b@digidescorp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7ce9c657-efba-5dbb-441d-acb00a13044b@digidescorp.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 08-02-19 22:06:59, Steve Magnani wrote: > On 2/8/19 11:34 AM, Steve Magnani wrote: > > In cases where the next unique ID or file/directory count of the > > in-core Logical Volume Integrity Descriptor have been updated, > > a sync() causes a (corrupt) LVID with a stale CRC to be written to disk. > > > > Ordinarily, this is corrected by an update of the on-disk LVID that occurs > > when the filesystem is unmounted. However, if power is lost or the > > filesystem resides on a device that is surprise-removed, the corrupt LVID > > remains and can complicate later remounting or fsck/chkdsk. Thanks for the patches! I've added them to my tree. Just they seem to be based on some relatively old kernel which required me to fixup some patch conflicts. Please try to base your patches on current upstream kernel if possible. Thanks! > "Complicate later remounting" turns out to be an understatement. > Actually it seems that this one event can trigger more silent corruption > of the filesystem on future remounts. > > The driver will mount without complaint a filesystem that lacks a valid LVID. > But in this scenario, every time lvid_get_unique_id() is called to generate > an ID for a new inode or link, it returns zero. It appears that callers > happily assign this zero to all new inodes or links, with no indication to > the user or in the syslog that a problem is brewing. > > I lost the entire contents of a flash disk to what was probably an > instance of this kind of corruption, when I told Windows chkdsk to > repair it. Ah, I'm sorry to hear that. > I'll try to solve that in a separate followon patchset. > The simplest solution I can think of is to force read-only mount when > no LVID is available. Agreed. OSTA UDF standard requires LVID to be present so forcing read-only mount is perfectly fine. Honza -- Jan Kara SUSE Labs, CR