[Top][All Lists]

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

Re: check_mntent_file() (was: Re: Resizing root partition)

From: Andrew Clausen
Subject: Re: check_mntent_file() (was: Re: Resizing root partition)
Date: Sun, 10 Aug 2003 10:16:05 +1000
User-agent: Mutt/1.5.4i

On Sat, Aug 09, 2003 at 11:46:21AM -0400, Theodore Ts'o wrote:
> > It isn't really a clean solution, though.  (It has 'heuristic'
> > written all over it!)
> Again, I'm missing context here; what are you concerned about?

The concern is resizing or otherwise messing with filesystems that are

Wrt "heuristic": why have two ways of checking?  Shouldn't the st_rdev
comparison always be sufficient?  Or is it something special for
loopback devices?

> > Eg: it will fail if the user runs:
> > 
> >     "parted /dev/hda"
> > 
> > And if they use devfs, everywhere else is using devfs names
> > (in /proc/mounts and /etc/mtab), and the partition of interest
> > (eg: /dev/hda1) doesn't exist.
> 1) If you're using devfs, devfs is so full of races and other bugs
> that you're basically inviting yourself to lose.  One more way of
> losing isn't all that interesting to me.  As of Linux 2.6, devfs is
> deprecated, and many kernel developers have never thought it was a
> good idea in the first place.

This problem isn't related to any devfs-isms... just the way some
people seem to be using it in the wild.

> 2) check_mntent_file is using stat to deal with aliased device nodes,
> which is about as much as it can handle.  If the partition doesn't
> exist, then obviously it can't be mounted; so what's the problem?

Consider the following:

in /proc/mounts:

in /dev:
/dev/hda /dev/hda1 /dev/hda2 /dev/something

Suppose /dev/something is an alias to /dev/hda.

Now, if the user invokes "parted /dev/something" in order to resize
the first partition therein, Parted needs to decide if "/dev/something1"
is mounted.  What if the device entry /dev/something1 doesn't exist?

Perhaps Parted should keep a database of device major/minors.
(Presumebly, the dev_t of /dev/something is available, and an
appropriate dev_t for /dev/something1 could be made available) Adding
"n" should never get false negatives, but perhaps false positives?
Worth worrying about?

Another issue that just occured to me is: when you remove
logical partitions, partition numbering will change.  Suppose
/dev/hda6 is mounted, and /dev/hda5 is deleted at the request of
the user.  Now, partitioning tools will see /dev/hda6 as /dev/hda5.
So, when the user goes to resize /dev/hda6 (which they will now
see as /dev/hda5), they won't get any warnings.  Unpleasant.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]