At Sat, 4 Dec 2021 10:25:27 +0100, "J. Hannken-Illjes" <hann...@mailbox.org> 
wrote:
Subject: Re: mount_union(8) vs. open(O_RDWR)
>
> Ok some comments:
>
> - union_copyup() works and is needed for regular nodes only.
>
> - it copies the node attributes up so checking the access on
>   the (copied) upper node should be sufficient.
>
> - the switch() on top checks for read-only mounted upper layer,
>   not the lower layer.

Ah ha!  That was not obvious to me at all.

I assumed, incorrectly apparently, that (struct vop_access_args).a_vp
would be the vnode for the lower layer in the case I was interested in
since the upper one did not yet exist.

So what is "a_vp" pointing to in the case where the file does not yet
exist in the upper layer?  vnodeops(9) says (for VOP_ACCESS) "The
argument vp is the vnode of the file to check", but if it doesn't exist
yet (i.e. hasn't been copied up yet)???  (in the "recursive" calls made
by union_access() it is indeed either the upper vnode or lower vnode,
depending on what is going to be used)

> The attached diff just copies up in the VWRITE/VREG case and
> this should be sufficient -- please give it a try.

It works perfectly, thank you very much!

--
                                        Greg A. Woods <gwo...@acm.org>

Kelowna, BC     +1 250 762-7675           RoboHack <wo...@robohack.ca>
Planix, Inc. <wo...@planix.com>     Avoncote Farms <wo...@avoncote.ca>

Attachment: pgpUYQcLnc8ke.pgp
Description: OpenPGP Digital Signature

Reply via email to