Source-Changes archive

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

CVS commit: [netbsd-9] src/sys



Module Name:    src
Committed By:   martin
Date:           Mon Jun 21 14:50:57 UTC 2021

Modified Files:
        src/sys/kern [netbsd-9]: vfs_lookup.c vfs_vnops.c
        src/sys/sys [netbsd-9]: namei.src

Log Message:
Pull up following revision(s) (requested by dholland in ticket #1296):

        sys/sys/namei.src: revision 1.59        (via patch)
        sys/kern/vfs_vnops.c: revision 1.215
        sys/kern/vfs_lookup.c: revision 1.226

Add a new namei flag NONEXCLHACK for open with O_CREAT and not O_EXCL.
This case needs to be distinguished from the other CREATE operations
because it is supposed to successfully return (and open) the target if
it exists. In the case where that target is the root, or a mount
point, such that there's no parent dir, "real" CREATE operations fail,
but O_CREAT without O_EXCL needs to succeed.

So (a) add the flag, (b) test for it in namei in the situation
described above, (c) set it in open under the appropriate
circumstances, and (d) because this can result in namei returning
ni_dvp of NULL, cope with that case.

Should get into -9 and maybe even -8, because it was prompted by
issues with 3rd-party code. The use of a flag (vs. adding an
additional nameiop, which would be more appropriate) was deliberate to
make the patch small and noninvasive.


To generate a diff of this commit:
cvs rdiff -u -r1.212 -r1.212.2.1 src/sys/kern/vfs_lookup.c
cvs rdiff -u -r1.200 -r1.200.4.1 src/sys/kern/vfs_vnops.c
cvs rdiff -u -r1.42 -r1.42.2.1 src/sys/sys/namei.src

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.




Home | Main Index | Thread Index | Old Index