public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: Christoph Hellwig <hch@lst.de>
Cc: Lubomir Rintel <lkundrak@v3.sk>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH 3/3] [fs/sysv] V7: Add support for non-PDP11 v7 filesystems
Date: Sat, 24 Jul 2010 14:51:28 +0100	[thread overview]
Message-ID: <20100724135128.GA11645@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20100719145851.GD25279@lst.de>

On Mon, Jul 19, 2010 at 04:58:51PM +0200, Christoph Hellwig wrote:
> On Mon, Jul 19, 2010 at 07:16:42PM +0200, Lubomir Rintel wrote:
> > A mount-time option was added that makes it possible to override the
> > endianness and an attempt is made to autodetect it (which seems easy,
> > given the disk addresses are 3-byte.
> > 
> > No attempt is made to detect big-endian filesystems -- were there any?
> > Tested with PDP-11 v7 filesystems and PC-IX maintenance floppy.
> 
> Do you actually need the mount option?  We get away just fine with
> it for sysv filesystems.  And if not I'd be consistent and accept the
> options for both sysv and v7 filesystems.

Actually, it shouldn't be too hard to detect the damn thing even without magic.
Look - we always have the inode table starting at block 2, so on-disk root
inode is guaranteed to be found correctly.  Now, suppose we'd mistaken
l-e for pdp or vice versa; the half-words of i_size would get swapped.
What could pass both tests?  Suppose the right size is a * 65536 + b;
then we have: a and b are both multiples of 16 and at least one is non-zero.
So all we need is to reject root directories bigger than 1Mb.  And posted
patches do reject that (and lower than that, actually).

So I'd rather see a variant without that option.  Simply get both bh, then
try the same sanity checks with LE and PDP used for s_bytesex.  And use
one that works - we _know_ that it's impossible to have both pass at the
same time.

I'm fine with the rest of patch series as is; Lubomir, could you redo the
last one that way and resend?

  parent reply	other threads:[~2010-07-24 13:51 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-19 17:16 A few V7 fs improvements Lubomir Rintel
2010-07-19 14:53 ` Christoph Hellwig
2010-07-19 16:10 ` Bill Davidsen
2010-07-19 17:16 ` [PATCH 1/3] [fs/sysv] Add v7 alias Lubomir Rintel
2010-07-19 14:53   ` Christoph Hellwig
2010-07-19 17:16   ` [PATCH 2/3] [fs/sysv] V7: Adjust sanity checks for some volumes Lubomir Rintel
2010-07-19 14:54     ` Christoph Hellwig
2010-07-20 10:31       ` Lubomir Rintel
2010-07-22  1:11         ` [PATCH] " Lubomir Rintel
2010-07-19 17:16     ` [PATCH 3/3] [fs/sysv] V7: Add support for non-PDP11 v7 filesystems Lubomir Rintel
2010-07-19 14:58       ` Christoph Hellwig
2010-07-20 10:41         ` Lubomir Rintel
2010-07-22  1:17           ` Lubomir Rintel
2010-07-22  1:18             ` [PATCH] " Lubomir Rintel
2010-07-24 13:51         ` Al Viro [this message]
2010-07-25 22:59           ` Lubomir Rintel
2010-07-26  0:26             ` Randy Dunlap
2010-07-26 23:52             ` Andrew Morton
2010-07-27  0:19               ` Lubomir Rintel
2010-07-27  0:29                 ` Andrew Morton
2010-07-25  5:23 ` A few V7 fs improvements Artem Bityutskiy

Reply instructions:

You may reply publicly 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=20100724135128.GA11645@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=akpm@linux-foundation.org \
    --cc=hch@lst.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkundrak@v3.sk \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox