Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp268842imj; Fri, 8 Feb 2019 20:07:48 -0800 (PST) X-Google-Smtp-Source: AHgI3IZMBllYW7l7NOl9VpzT72FM2EQGtL06T3NsnAYbYAeDXzLBmBURriDSh2IL2wVNGIwgPBqu X-Received: by 2002:a17:902:bf0c:: with SMTP id bi12mr26845518plb.0.1549685268003; Fri, 08 Feb 2019 20:07:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549685267; cv=none; d=google.com; s=arc-20160816; b=kRKyc78xxnH9M/EK6cSNLSYCWsYYGnxVHfdYuoqEGWM0WDO12fMmTcj5aLI8dbt9Xq 6R3P652aF6ysseHq+QaSZ05sQpFrw4mXETXX2a6XaFEhO+RR/RmO+W5DYgTyffJHMB/s 1Cd1NiTOmF+u9aQljEuA0h4BCqYd3YgnKAWEq0lq1274fSupR/gUOtkNTt4OKzQU8uPK gKqTU96kzfzfdkqiboEHsMUnw0CvyKpc9SIjXefouGDCE9a9Bcv3Rtm2z6wSwhcZBc+z Cf74O1sUT8Ef5HehDUQXPFuzzxbYK//KZnMb0vhTgMp47PrB7vJrm/T2gLtCyFIbeknC vMtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:from:subject:dkim-signature; bh=7LZNbZgGlOZ24T8n6zWfi9+M16V+/eb3pxq0kNbN8/k=; b=YORSsiXx6Dyac8DP0D+68awYNpCdWBeyuzk9GgpMj1XFxOP8Lrs+WkealtuNpjYQA5 G0Aob8EL6/5yBo9Cw00zEdxEOtIQ0RthHFJ5ryW8rET7n0rAzSXEJi12PErAl7YIMcOT VSb8ofoboO8aFNSV/ZTaJSvQ0IxoGAIGNgAkct3HI24bMLfODia87YrGFW2wnSLr4DeU j1Kf+pR70Yb0hg29315cgcDNqzgIjFJD9m0ppv+bveDIfCnV21jPRN/p1j4P6uzjoevj BAg20V4KN2zkr0nPJwclVBeDIlPF6kuR+VWmcSYQO/3z4qorUuLCxKW63TdmONTjFBf2 t3+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@digidescorp.com header.s=google header.b=UWdvB8f7; 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 39si4562834plc.153.2019.02.08.20.07.09; Fri, 08 Feb 2019 20:07:47 -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=@digidescorp.com header.s=google header.b=UWdvB8f7; 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 S1726755AbfBIEHC (ORCPT + 99 others); Fri, 8 Feb 2019 23:07:02 -0500 Received: from mail-it1-f195.google.com ([209.85.166.195]:34375 "EHLO mail-it1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726222AbfBIEHC (ORCPT ); Fri, 8 Feb 2019 23:07:02 -0500 Received: by mail-it1-f195.google.com with SMTP id x124so10502194itd.1 for ; Fri, 08 Feb 2019 20:07:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=digidescorp.com; s=google; h=subject:from:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=7LZNbZgGlOZ24T8n6zWfi9+M16V+/eb3pxq0kNbN8/k=; b=UWdvB8f7wXTs1fxDk9GEu9D3xPwazb72vEcADoosrXbBjt7kilbo3HcPxMIfv3qeoV n0Tk8UlLKeU53pHHkE6EleQGtMIJbioSoWgCm3QRT/Ok9J23TGuwtlyLL3n+rEILixgn SqzUexU4HI5nfulR7tZ3AnIKLNFpfU9MDI+EA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=7LZNbZgGlOZ24T8n6zWfi9+M16V+/eb3pxq0kNbN8/k=; b=PQGcwRCc5HGXq+ix0CBGFysz/4zLUfPQ8FY5rJGZuSqXz8SjXUwIgprdHYiC4j1H6V LM1+YEVoMwY7RroYrCnmQON5Wn8tlle6eOBIL61zq1YVqna0d/IJOX5446uo0w77LTNb 8wFo0pihUTKywlBqjSQl//MqLL6PkXcpUoNOoKlUalleJU0equ+9chwqkaQKEer4ULvl pG3CWlolSolnQhf/sQSXiQpKLoMVFvck9tDV0lYP0JY9C30QoG5o1LBmljSugQR40rsu S5FPtY/QhwB5dpFyMQQBIyRbIn3eSoIbFzykzRcg+GWGZhbPKO/vVJKcqajuF2z1n0Sp lpgQ== X-Gm-Message-State: AHQUAuauuouevQG3xABrEQmV4xamfUzKesJ2fHw3fJsBlzLHRF9N4atK TyN6hve2w6xtPyWPvJ6d+bNSnrvCJrk= X-Received: by 2002:a02:5b05:: with SMTP id g5mr14160817jab.84.1549685221516; Fri, 08 Feb 2019 20:07:01 -0800 (PST) Received: from [10.10.2.64] (104-51-28-62.lightspeed.cicril.sbcglobal.net. [104.51.28.62]) by smtp.googlemail.com with ESMTPSA id q12sm295259ioi.54.2019.02.08.20.07.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Feb 2019 20:07:00 -0800 (PST) Subject: Re: [PATCH 0/2] udf: Fix corrupt on-disk integrity descriptor following sync() From: Steve Magnani To: jack@suse.com Cc: linux-kernel@vger.kernel.org References: <20190208173455.20151-1-steve@digidescorp.com> Message-ID: <7ce9c657-efba-5dbb-441d-acb00a13044b@digidescorp.com> Date: Fri, 8 Feb 2019 22:06:59 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <20190208173455.20151-1-steve@digidescorp.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. "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. 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. Regards, ------------------------------------------------------------------------  Steven J. Magnani               "I claim this network for MARS!  www.digidescorp.com              Earthling, return my space modulator!"  #include