From: <devel-boun...@openvz.org<mailto:devel-boun...@openvz.org>> on behalf of 
Kir Kolyshkin <k...@openvz.org<mailto:k...@openvz.org>>
Date: Friday 15 April 2016 01:35
To: "devel@openvz.org<mailto:devel@openvz.org>" 
<devel@openvz.org<mailto:devel@openvz.org>>
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
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to