Source-Changes archive

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

CVS commit: src/sys



Module Name:    src
Committed By:   dholland
Date:           Wed Jun 16 01:51:57 UTC 2021

Modified Files:
        src/sys/kern: vfs_lookup.c vfs_vnops.c
        src/sys/sys: namei.src

Log Message:
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.225 -r1.226 src/sys/kern/vfs_lookup.c
cvs rdiff -u -r1.214 -r1.215 src/sys/kern/vfs_vnops.c
cvs rdiff -u -r1.58 -r1.59 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