DriverDev-Devel Archive on lore.kernel.org
 help / color / Atom feed
From: "Valdis Klētnieks" <valdis.kletnieks@vt.edu>
To: "Pali Rohár" <pali.rohar@gmail.com>
Cc: Sasha Levin <sashal@kernel.org>,
	devel@driverdev.osuosl.org, Christoph Hellwig <hch@infradead.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-kernel@vger.kernel.org,
	Sasha Levin <alexander.levin@microsoft.com>,
	linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] staging: exfat: add exfat filesystem code to staging
Date: Fri, 14 Feb 2020 18:25:38 -0500
Message-ID: <89492.1581722738@turing-police> (raw)
In-Reply-To: <20200214224357.yv2lwyusi3gwolp3@pali>

[-- Attachment #1.1: Type: text/plain, Size: 1362 bytes --]


> Idea is simple. Expects that we have a clean filesystem in correct
> state. We load primary/active/main FAT table (just call it FAT1) and all
> changes to filesystem would be done via second non-active FAT table
> (FAT2). At unmount or sync or flush buffer times, FAT2 would be copied
> back to the FAT1 and filesystem would be back in clean state.

Somehow, scribbling on the non-active table for actual changes sounds like a
bad idea waiting to happen (partly because if you do that and crash, after the
reboot you remount, and it starts up with the now-stale FAT1 because you never
flagged that FAT as stale.

That means that if we started using the secondary FAT, we'd change the
ActiveFAT variable to indicate that.  And if we do that, we need to also set
num_fat to 2 because num_fat 1 and ActiveFAT pointing at the second FAT is
*definitely* bogus.

And that could result in us crashing and leaving the device with a header that
says 'num_fat == 2', ActiveFAT == second, and the dirty bit set - and the user
next uses the  filesystem on a system/device that hard-codes that there's only 1 FAT,
so it blindly goes on its merry way using a FAT that's stale and never realizing it.

And that's actually the same failure mode as in the first paragraph - you start
off using FAT1 because you don't see an indication that it's stale.

[-- Attachment #1.2: Type: application/pgp-signature, Size: 832 bytes --]

[-- Attachment #2: Type: text/plain, Size: 169 bytes --]

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

  reply index

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20190828160817.6250-1-gregkh@linuxfoundation.org>
     [not found] ` <20190829205631.uhz6jdboneej3j3c@pali>
2019-08-30 15:40   ` Christoph Hellwig
2019-08-30 15:43     ` Pali Rohár
     [not found]   ` <184209.1567120696@turing-police>
     [not found]     ` <20190829233506.GT5281@sasha-vm>
     [not found]       ` <20190830075647.wvhrx4asnkrfkkwk@pali>
2019-10-16 14:03         ` Pali Rohár
2019-10-16 14:31           ` Sasha Levin
2019-10-16 16:03             ` Pali Rohár
2019-10-16 16:20               ` Sasha Levin
2019-10-16 16:22               ` Greg Kroah-Hartman
2019-10-16 16:32                 ` Pali Rohár
2019-10-16 16:50                   ` Greg Kroah-Hartman
2019-10-16 20:33               ` Sasha Levin
2019-10-16 21:53                 ` Valdis Klētnieks
2019-10-17  7:53                   ` Pali Rohár
2019-10-17  7:50                 ` Pali Rohár
2020-02-13  0:06                   ` Pali Rohár
2020-02-13 21:18                     ` Sasha Levin
2020-02-14 22:16                       ` Valdis Klētnieks
2020-02-14 22:43                         ` Pali Rohár
2020-02-14 23:25                           ` Valdis Klētnieks [this message]
2019-10-16 16:05             ` Valdis Klētnieks
     [not found] ` <20190828170022.GA7873@kroah.com>
     [not found]   ` <20190829062340.GB3047@infradead.org>
     [not found]     ` <20190829063955.GA30193@kroah.com>
     [not found]       ` <20190829094136.GA28643@infradead.org>
     [not found]         ` <20190829095019.GA13557@kroah.com>
     [not found]           ` <20190829103749.GA13661@infradead.org>
     [not found]             ` <20190829111810.GA23393@kroah.com>
2019-08-30 15:36               ` Christoph Hellwig
2019-08-30 21:54               ` Dave Chinner
2019-08-31 10:31                 ` Valdis Klētnieks
2019-09-01  0:04                   ` Dave Chinner
     [not found]               ` <20190829151144.GJ23584@kadam>
     [not found]                 ` <20190829152757.GA125003@architecture4>
     [not found]                   ` <20190829154346.GK23584@kadam>
     [not found]                     ` <cd38b645-2930-3e02-6c6a-5972ea02b537@huawei.com>
     [not found]                       ` <20190830115142.GM2752@twin.jikos.cz>
2019-08-31  3:50                         ` Chao Yu
2019-09-14 13:39 ` [PATCH] staging: exfat: add exfat filesystem code to Park Ju Hyung
2019-09-15 13:54   ` Greg KH
2019-09-15 16:11     ` Ju Hyung Park
     [not found] ` <20190918195920.25210-1-qkrwngud825@gmail.com>
2019-09-18 20:12   ` [PATCH] staging: exfat: rebase to sdFAT v2.2.0 Greg KH
2019-09-18 20:13   ` Greg KH
2019-09-18 20:22     ` Ju Hyung Park
2019-09-18 20:26       ` Greg KH
2019-09-18 20:31         ` Ju Hyung Park
2019-09-18 20:46           ` Valdis Klētnieks
2019-09-18 21:31   ` kbuild test robot
2019-09-18 21:31   ` kbuild test robot
2019-09-18 22:17     ` Ju Hyung Park
2019-10-24  9:39 ` [PATCH] staging: exfat: add exfat filesystem code to staging Pali Rohár

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=89492.1581722738@turing-police \
    --to=valdis.kletnieks@vt.edu \
    --cc=alexander.levin@microsoft.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hch@infradead.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pali.rohar@gmail.com \
    --cc=sashal@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

DriverDev-Devel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/driverdev-devel/0 driverdev-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 driverdev-devel driverdev-devel/ https://lore.kernel.org/driverdev-devel \
		driverdev-devel@linuxdriverproject.org devel@driverdev.osuosl.org
	public-inbox-index driverdev-devel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.linuxdriverproject.driverdev-devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git