NetBSD-Bugs archive

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

Re: kern/46626: EROFS enforcement in namei breaks union mounts

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

From: David Laight <>
Subject: Re: kern/46626: EROFS enforcement in namei breaks union mounts
Date: Mon, 25 Jun 2012 07:55:19 +0100

 On Sun, Jun 24, 2012 at 11:15:00PM +0000, wrote:
 > As I understand the way union mounts are supposed to work based on
 > Plan 9, for any operation, the layer in a union stack where the named
 > target exists should be selected to perform the operation. If the
 > named target does not exist, the top layer should be used. Having a
 > read-only upper layer arbitrarily intercept and deny all write
 > operations breaks these semantics.
 Letting a rename move files between layers does seem a little wrong!
 > (There's another wrinkle with rename, which is that if the to-file
 > doesn't exist, the layer of the from-file should be selected.
 > Otherwise, most rename operations will give EXDEV. This is not easy to
 > arrange, but it's a different problem.)
 I think the layer of the from-file should always be selected.
 This might mean you can move a file so that it is hidden! but
 you really don't want to move a file from a low-layer into a
 higher layer just because the file exists in the higher layer.
 Does the NetBSD code auto-created (and auto-delete) directories
 in the top layer?
 Somewhere I've probably got the sources for a 32-layer union
 mount filesystem (for SYSV) - which I fixed somewhat!
 Unless a specific layer was specified (append "\\n" to the name)
 all creates were done in layer 0, everything else just did a
 scan through the directories then 'handed off' the request to
 the located vnode.
 (Directory reads are hard, IIRC I left them O(N^2)).
 It was a shame that the kernel exec code didn't allow for VOP_OPEN()
 changing the vnode - otherwise the whole fs would only have had
 to process VOP_LOOKUP() and directory requests!
 David Laight:

Home | Main Index | Thread Index | Old Index