tech-kern archive

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

Re: mount_union(8) vs. open(O_RDWR)



At Sat, 4 Dec 2021 10:25:27 +0100, "J. Hannken-Illjes" <hannken%mailbox.org@localhost> 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 <gwoods%acm.org@localhost>

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

Attachment: pgp8ldiMOAXhc.pgp
Description: OpenPGP Digital Signature



Home | Main Index | Thread Index | Old Index