NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/43573: ffs superblock search prevents mounting tiny file systems



The following reply was made to PR kern/43573; it has been noted by GNATS.

From: Antti Kantee <pooka%iki.fi@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: kern/43573: ffs superblock search prevents mounting tiny file 
systems
Date: Mon, 5 Jul 2010 23:03:46 +0300

 On Mon Jul 05 2010 at 19:40:03 +0000, David Holland wrote:
 >   > maybe this, although I haven't done any critical thinking about it.
 >   > 
 >   > [...]
 >   >                 if (error) {
 >   > -                       fs = NULL;
 >   > -                       goto out;
 >   > +                       continue;
 >   >                 }
 >  
 >  That should at least test for the expected error code... but wouldn't
 >  it be a better plan to check the block number against the volume size?
 
 Sure testing against the size before the call is better.  But how do you
 reliably do that and as an added challenge be unracy (*)?  getdisksize()
 fails for some media and arbitrarily breaking file system mounts because
 of this is not acceptable.  VOP_GETATTR() result for devvp gives some
 cached value that may or may not reflect reality.  So I say we "ask"
 the driver about the size in the form of the actual request and be happy
 with that.
 
 *) yes, if your media size changes from below you, you're probably in
 trouble anyway, but no reason to go digging for trouble.
 


Home | Main Index | Thread Index | Old Index