tech-kern archive

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

Re: mount_checkdirs



On Mon 06 Jul 2015 at 09:58:59 +0000, David Holland wrote:

> Also it's occasionally useful to mount over things and leave a process
> underneath, which this logic seems to complicate.

If I read the code correctly, it looks for processes that have a current
working directory or root directory exactly at the mount point. But the
mount point directory does not need to be empty. A process could have a
cwd or root in any directory inside it. So as-is, the code is
insufficient for its intended purpose anyway.

Furthermore, the process can have open files from that directory tree.
If its cwd or root gets changed (and into what exactly, if it isn't the
exact mount point?) it has files open that it can't find anymore with
another call to open(2). That seems like an inconsistency that we may
want to avoid due to the POLA.

It seems inconsistent to me to "fix" processes that are exactly at the
mountpoint directory, but not ones more inside.

A possible reason not to handle subdirectories could have been that
semantics for that are unclear. But one would have expected some note
about that somewhere, given the above.

-Olaf.
-- 
___ Olaf 'Rhialto' Seibert  -- The Doctor: No, 'eureka' is Greek for
\X/ rhialto/at/xs4all.nl    -- 'this bath is too hot.'

Attachment: pgpenTTfJKUiD.pgp
Description: PGP signature



Home | Main Index | Thread Index | Old Index