<div dir="ltr"><div><div>wow.  im surprised.  this caught my eye, checked into the mode: <br><br>glfs_mkdir (struct glfs *fs, const char *path, mode_t mode)<br><br></div>So, somehow, the python API is capable of sending a &quot;mode&quot; which doesnt correspond to anything enumerated as part of the mode_t, but the C method still manages to write the file with a &quot;garbage mode&quot; ?  <br>
<br></div>That sounds like a bug not in python.  Not in gluster... but in C ! :)  [if im understanding this correctyle, which i might not be]<br><div><div><br><br><br><br><br><br><br></div></div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Mon, Oct 28, 2013 at 7:19 PM, Anand Avati <span dir="ltr">&lt;<a href="mailto:avati@gluster.org" target="_blank">avati@gluster.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">glfs_mkdir() (in glfs.h) accepts three params - @fs, @path, @mode. gfapi.py uses raw ctypes to provide python APIs - and therefore the bug of not accepting and passing @mode in the mkdir() method in gfapi.py is translating into a junk value getting received by glfs_mkdir (and random modes getting set for various dirs). You  just witnessed the woe of a typeless system :)<span class="HOEnZb"><font color="#888888"><div>

<br></div><div>Avati</div></font></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Oct 28, 2013 at 1:31 PM, Justin Clift <span dir="ltr">&lt;<a href="mailto:jclift@redhat.com" target="_blank">jclift@redhat.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Avati,<br>
<br>
When creating directories through glfs_mkdir() - called through<br>
Python - the directories have inconsistent mode permissions.<br>
<br>
Is this expected?<br>
<br>
Here&#39;s the super simple code running directly in a Python<br>
2.7.5 shell, on F19.  It&#39;s a simple single brick volume,<br>
XFS underneath.  Gluster compiled from git master head over<br>
the weekend:<br>
<br>
  &gt;&gt;&gt; vol.mkdir(&#39;asdf&#39;)<br>
  0<br>
  &gt;&gt;&gt; vol.mkdir(&#39;asdf/111&#39;)<br>
  0<br>
  &gt;&gt;&gt; vol.mkdir(&#39;asdf/112&#39;)<br>
  0<br>
  &gt;&gt;&gt; vol.mkdir(&#39;asdf/113&#39;)<br>
  0<br>
  &gt;&gt;&gt; vol.mkdir(&#39;asdf/114&#39;)<br>
  0<br>
  &gt;&gt;&gt; vol.mkdir(&#39;asdf/115&#39;)<br>
  0<br>
  &gt;&gt;&gt; vol.mkdir(&#39;asdf/116&#39;)<br>
  0<br>
  &gt;&gt;&gt; vol.mkdir(&#39;asdf/117&#39;)<br>
  0<br>
<br>
Looks ok from here, but ls -la shows the strangeness of<br>
the subdirs:<br>
<br>
  $ sudo ls -la asdf/<br>
  total 0<br>
  dr-x-w----. 9 root root  76 Oct 28 20:22 .<br>
  drwxr-xr-x. 8 root root 114 Oct 28 20:22 ..<br>
  d-w--w---T. 2 root root   6 Oct 28 20:22 111<br>
  d--x--x--T. 2 root root   6 Oct 28 20:22 112<br>
  dr--rw---T. 2 root root   6 Oct 28 20:22 113<br>
  drwx--x---. 2 root root   6 Oct 28 20:22 114<br>
  dr--r----T. 2 root root   6 Oct 28 20:22 115<br>
  dr-x-w----. 2 root root   6 Oct 28 20:22 116<br>
  drwx--x---. 2 root root   6 Oct 28 20:22 117<br>
<br>
Easily worked around using chmod() after each mkdir(), but<br>
I&#39;m not sure if this is a bug or not.<br>
<br>
?<br>
<br>
Regards and best wishes,<br>
<br>
Justin Clift<br>
<br>
--<br>
Open Source and Standards @ Red Hat<br>
<br>
<a href="http://twitter.com/realjustinclift" target="_blank">twitter.com/realjustinclift</a><br>
<br>
</blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
Gluster-devel mailing list<br>
<a href="mailto:Gluster-devel@nongnu.org">Gluster-devel@nongnu.org</a><br>
<a href="https://lists.nongnu.org/mailman/listinfo/gluster-devel" target="_blank">https://lists.nongnu.org/mailman/listinfo/gluster-devel</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Jay Vyas<br><a href="http://jayunit100.blogspot.com" target="_blank">http://jayunit100.blogspot.com</a>
</div>