From: <[email protected]<mailto:[email protected]>> on behalf of Kir Kolyshkin <[email protected]<mailto:[email protected]>> Date: Friday 15 April 2016 01:35 To: "[email protected]<mailto:[email protected]>" <[email protected]<mailto:[email protected]>> Subject: [Devel] O_NONBLOCK for directory
I am reviewing recent VZ7 libploop commits, in particular, this one: https://src.openvz.org/projects/OVZ/repos/ploop/commits/36df847b9 I left a question there, let me repeat it here in a hope someone answers. Igor Sukhih committed 36df847b99c<https://src.openvz.org/projects/OVZ/repos/ploop/commits/36df847b99c92557c69255ebfb00d4cc74cb51ac>Yesterday ploop_copy_init(): open folder with O_DIRECTORY flag ... - _h->mntfd = open(mnt, O_RDONLY); + _h->mntfd = open(mnt, O_RDONLY|O_NONBLOCK|O_DIRECTORY); 1. What's the reason for adding O_NONBLOCK here? As far as I can see, it doesn't change anything at all (neither in this open(), nor in subsequent syncfs(), ioctl() and close())? I went as far as the kernel sources to check that O_NONBLOCK doesn't affect syncfs() call, but maybe I'm mistaken? Added accidentally, you are right, it doesn't change anything. 2. What's the reason for adding O_DIRECTORY? Ideally, the changelog should say why we're doing it, not what we do (as it's pretty clear from the patch itself). It does exactly as specified - enforces open file to be a directory. Any problems with this enforcement? Thank you, Dmitry. Regards, Kir.
_______________________________________________ Devel mailing list [email protected] https://lists.openvz.org/mailman/listinfo/devel
