<feed xmlns='http://www.w3.org/2005/Atom'>
<title>glusterfs.git/xlators/mount, branch v3.3.2</title>
<subtitle></subtitle>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/'/>
<entry>
<title>mount/fuse: add mount-option "enable-ino32" for the native client</title>
<updated>2013-02-07T21:38:20+00:00</updated>
<author>
<name>Niels de Vos</name>
<email>ndevos@redhat.com</email>
</author>
<published>2012-09-03T11:34:22+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/commit/?id=fbb9ad5030abf058ce75af1890b7ec1be77d22f9'/>
<id>fbb9ad5030abf058ce75af1890b7ec1be77d22f9</id>
<content type='text'>
By default the GlusterFS-native client uses 64-bit inodes. Some 32-bit
applications can not handle these correctly. Introduce a client-side
mount option "enable-ino32" which causes the FUSE-client to squash the
64-bit inodes into a 32-bit value.

Change-Id: I7544010a27b7eb2d3b9fadb84ed934e4e7dff21e
BUG: 850352
Signed-off-by: Niels de Vos &lt;ndevos@redhat.com&gt;
Reviewed-on: http://review.gluster.org/3886
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Anand Avati &lt;avati@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
By default the GlusterFS-native client uses 64-bit inodes. Some 32-bit
applications can not handle these correctly. Introduce a client-side
mount option "enable-ino32" which causes the FUSE-client to squash the
64-bit inodes into a 32-bit value.

Change-Id: I7544010a27b7eb2d3b9fadb84ed934e4e7dff21e
BUG: 850352
Signed-off-by: Niels de Vos &lt;ndevos@redhat.com&gt;
Reviewed-on: http://review.gluster.org/3886
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Anand Avati &lt;avati@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>glusterfs SEGV on Fedora 17 from UFO fallocate(2) call</title>
<updated>2012-09-17T21:49:59+00:00</updated>
<author>
<name>Kaleb S. KEITHLEY</name>
<email>kkeithle@redhat.com</email>
</author>
<published>2012-09-13T20:21:07+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/commit/?id=517a9d2450c4de6229d2b699a2ffd9102c3488c9'/>
<id>517a9d2450c4de6229d2b699a2ffd9102c3488c9</id>
<content type='text'>
An upload of a file will cause the volume's glusterfs to SEGV
when it fields a FUSE_FALLOCATE op. Swift inspects libc to determine
if there is a symbol for fallocate(2) and if so will use it. And
while the libc in RHEL 6 does have fallocate(2), the version of
fuse in RHEL 6 does not support fallocate, and things are handled
gracefully elsewhere (the kernel perhaps?)

N.B. fallocate was added to version 7.19 of fuse. Fedora 17 and
later (and maybe earlier too) has 7.19. RHEL 6 still has 7.13.
Glusterfs uses the 7.13 version &lt;linux/fuse.h&gt;
(in contrib/fuse-include/fuse_kernel.h)

Thus on Fedora 17, with both fallocate(2) in libc and fallocate
support in fuse, the fallocate invocation is dispatched to glusterfs,
but the dispatch table (fuse_std_ops in
xlators/mount/fuse/src/fuse-bridge.c) is too short for one thing;
the fallocate opcode (43) indexes beyond the end of the table, and
even when that doesn't directly cause a SEGV, the NULL pointer at
that location does cause a SEGV when attempting to call the function
through the pointer.

BUG: 856704
Change-Id: Iffe3994dde6ca29444d07d27eb04d6f86773fa03
Signed-off-by: Kaleb S. KEITHLEY &lt;kkeithle@redhat.com&gt;
Reviewed-on: http://review.gluster.org/3941
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Mohammed Junaid &lt;junaid@redhat.com&gt;
Reviewed-by: Anand Avati &lt;avati@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
An upload of a file will cause the volume's glusterfs to SEGV
when it fields a FUSE_FALLOCATE op. Swift inspects libc to determine
if there is a symbol for fallocate(2) and if so will use it. And
while the libc in RHEL 6 does have fallocate(2), the version of
fuse in RHEL 6 does not support fallocate, and things are handled
gracefully elsewhere (the kernel perhaps?)

N.B. fallocate was added to version 7.19 of fuse. Fedora 17 and
later (and maybe earlier too) has 7.19. RHEL 6 still has 7.13.
Glusterfs uses the 7.13 version &lt;linux/fuse.h&gt;
(in contrib/fuse-include/fuse_kernel.h)

Thus on Fedora 17, with both fallocate(2) in libc and fallocate
support in fuse, the fallocate invocation is dispatched to glusterfs,
but the dispatch table (fuse_std_ops in
xlators/mount/fuse/src/fuse-bridge.c) is too short for one thing;
the fallocate opcode (43) indexes beyond the end of the table, and
even when that doesn't directly cause a SEGV, the NULL pointer at
that location does cause a SEGV when attempting to call the function
through the pointer.

BUG: 856704
Change-Id: Iffe3994dde6ca29444d07d27eb04d6f86773fa03
Signed-off-by: Kaleb S. KEITHLEY &lt;kkeithle@redhat.com&gt;
Reviewed-on: http://review.gluster.org/3941
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Mohammed Junaid &lt;junaid@redhat.com&gt;
Reviewed-by: Anand Avati &lt;avati@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mount.glusterfs: Add support for {attribute,entry}-timeout options</title>
<updated>2012-09-17T19:12:23+00:00</updated>
<author>
<name>Kaushal M</name>
<email>kaushal@redhat.com</email>
</author>
<published>2012-08-22T11:23:04+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/commit/?id=314dd4da976cd329417b43c3ad281fd9990fdcd7'/>
<id>314dd4da976cd329417b43c3ad281fd9990fdcd7</id>
<content type='text'>
Change-Id: Ib0c9b5be6f05cf9a36271df67e5e5c251c4c4628
BUG: 829279
Signed-off-by: Kaushal M &lt;kaushal@redhat.com&gt;
Reviewed-on: http://review.gluster.org/3840
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Brian Foster &lt;bfoster@redhat.com&gt;
Reviewed-by: Jeff Darcy &lt;obdurodon@gmail.com&gt;
Reviewed-by: Vijay Bellur &lt;vbellur@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change-Id: Ib0c9b5be6f05cf9a36271df67e5e5c251c4c4628
BUG: 829279
Signed-off-by: Kaushal M &lt;kaushal@redhat.com&gt;
Reviewed-on: http://review.gluster.org/3840
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Brian Foster &lt;bfoster@redhat.com&gt;
Reviewed-by: Jeff Darcy &lt;obdurodon@gmail.com&gt;
Reviewed-by: Vijay Bellur &lt;vbellur@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mount.glusterfs NerBSD portability fix</title>
<updated>2012-09-12T19:39:41+00:00</updated>
<author>
<name>Emmanuel Dreyfus</name>
<email>manu@netbsd.org</email>
</author>
<published>2012-09-10T14:07:13+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/commit/?id=80ef34fea4a8850b6f34dc59dcdfaef989d7b9e5'/>
<id>80ef34fea4a8850b6f34dc59dcdfaef989d7b9e5</id>
<content type='text'>
NetBSD stat(1) gets inode using -f %i while Linux uses -c %i
This has already been fixed a few lines above, but one test
failed to be fixed.

This is not based on master, as the code hasbeen reworked a lot,
and is already bug-free.

BUG: 764655
Change-Id: I5dc1196ddba06ff31f695b7dbb0c6d28df32f324
Signed-off-by: Emmanuel Dreyfus &lt;manu@netbsd.org&gt;
Reviewed-on: http://review.gluster.org/3926
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Anand Avati &lt;avati@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
NetBSD stat(1) gets inode using -f %i while Linux uses -c %i
This has already been fixed a few lines above, but one test
failed to be fixed.

This is not based on master, as the code hasbeen reworked a lot,
and is already bug-free.

BUG: 764655
Change-Id: I5dc1196ddba06ff31f695b7dbb0c6d28df32f324
Signed-off-by: Emmanuel Dreyfus &lt;manu@netbsd.org&gt;
Reviewed-on: http://review.gluster.org/3926
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Anand Avati &lt;avati@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>NetBSD build fixes</title>
<updated>2012-07-13T21:08:22+00:00</updated>
<author>
<name>Emmanuel Dreyfus</name>
<email>manu@netbsd.org</email>
</author>
<published>2012-07-06T14:53:35+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/commit/?id=74d7d2d53c539c822cf7b6da44a515f1e326c5bc'/>
<id>74d7d2d53c539c822cf7b6da44a515f1e326c5bc</id>
<content type='text'>
This is a backport of Change-Id: Icd7290f1e340675d763665a0d0c5f95bc14e0c55

BUG: 764655
Change-Id: Iaca3dc30e61c0864af673b90d2a7fdea6a3143cc
Signed-off-by: Emmanuel Dreyfus &lt;manu@netbsd.org&gt;
Reviewed-on: http://review.gluster.com/3577
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Anand Avati &lt;avati@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is a backport of Change-Id: Icd7290f1e340675d763665a0d0c5f95bc14e0c55

BUG: 764655
Change-Id: Iaca3dc30e61c0864af673b90d2a7fdea6a3143cc
Signed-off-by: Emmanuel Dreyfus &lt;manu@netbsd.org&gt;
Reviewed-on: http://review.gluster.com/3577
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Anand Avati &lt;avati@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Set LD_LIBRARY_PATH before starting glusterfs</title>
<updated>2012-07-09T12:41:28+00:00</updated>
<author>
<name>Emmanuel Dreyfus</name>
<email>manu@netbsd.org</email>
</author>
<published>2012-06-15T07:53:34+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/commit/?id=f626ea8e9121baab4c0447f9aaf273e1141a79ed'/>
<id>f626ea8e9121baab4c0447f9aaf273e1141a79ed</id>
<content type='text'>
This is a backport of Change-Id: I13bf0bea043351498b4bc885c5ac45b108229a0a

BUG: 764655
Change-Id: I7908352f7a9baae48a7c3bd2c8845980d0dc9b96
Signed-off-by: Emmanuel Dreyfus &lt;manu@netbsd.org&gt;
Reviewed-on: http://review.gluster.com/3578
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Vijay Bellur &lt;vbellur@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is a backport of Change-Id: I13bf0bea043351498b4bc885c5ac45b108229a0a

BUG: 764655
Change-Id: I7908352f7a9baae48a7c3bd2c8845980d0dc9b96
Signed-off-by: Emmanuel Dreyfus &lt;manu@netbsd.org&gt;
Reviewed-on: http://review.gluster.com/3578
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Vijay Bellur &lt;vbellur@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>stat(1) flag to specify format is not portable</title>
<updated>2012-07-09T12:40:34+00:00</updated>
<author>
<name>Emmanuel Dreyfus</name>
<email>manu@netbsd.org</email>
</author>
<published>2012-06-15T07:55:28+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/commit/?id=ca297bc9ba096c64e182872692981a1d7ee250fa'/>
<id>ca297bc9ba096c64e182872692981a1d7ee250fa</id>
<content type='text'>
This is a backport of Change-Id: Iae3c40b03118078530c29d14d5f7180c36361c16

BUG: 764655
Change-Id: Ic4e7adbda6b53b248aa93cd20a045cb885fa818e
Signed-off-by: Emmanuel Dreyfus &lt;manu@netbsd.org&gt;
Reviewed-on: http://review.gluster.com/3579
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Vijay Bellur &lt;vbellur@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is a backport of Change-Id: Iae3c40b03118078530c29d14d5f7180c36361c16

BUG: 764655
Change-Id: Ic4e7adbda6b53b248aa93cd20a045cb885fa818e
Signed-off-by: Emmanuel Dreyfus &lt;manu@netbsd.org&gt;
Reviewed-on: http://review.gluster.com/3579
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Vijay Bellur &lt;vbellur@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mount.glusterfs: update the glusterd WORKDIR</title>
<updated>2012-07-03T12:02:44+00:00</updated>
<author>
<name>Amar Tumballi</name>
<email>amarts@redhat.com</email>
</author>
<published>2012-06-04T10:35:49+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/commit/?id=4f31c4ccd36ed446f705fa7537e81b753de3d85d'/>
<id>4f31c4ccd36ed446f705fa7537e81b753de3d85d</id>
<content type='text'>
Change-Id: I70d091611d314598412b5315adcbe1b5147a8773
Signed-off-by: Amar Tumballi &lt;amarts@redhat.com&gt;
BUG: 824231
Reviewed-on: http://review.gluster.com/3512
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Vijay Bellur &lt;vijay@gluster.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change-Id: I70d091611d314598412b5315adcbe1b5147a8773
Signed-off-by: Amar Tumballi &lt;amarts@redhat.com&gt;
BUG: 824231
Reviewed-on: http://review.gluster.com/3512
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Vijay Bellur &lt;vijay@gluster.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fuse: make SELinux support configurable</title>
<updated>2012-05-30T05:58:07+00:00</updated>
<author>
<name>Anand Avati</name>
<email>avati@redhat.com</email>
</author>
<published>2012-05-30T05:01:42+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/commit/?id=f69785a9e3f9ad55e81f1fe8212485b7e4dc11fe'/>
<id>f69785a9e3f9ad55e81f1fe8212485b7e4dc11fe</id>
<content type='text'>
Make support for SELinux labels (extended attributes) configurable
and disabled by default as it can cause significant performance
penalty when enabled (it need not be enabled unless specially crafted
policies are set -- which is not by default)

Change-Id: I97bc4b1c26cf055fd520e9bf2d49e52b14fe7515
BUG: 811217
Signed-off-by: Anand Avati &lt;avati@redhat.com&gt;
Reviewed-on: http://review.gluster.com/3485
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Make support for SELinux labels (extended attributes) configurable
and disabled by default as it can cause significant performance
penalty when enabled (it need not be enabled unless specially crafted
policies are set -- which is not by default)

Change-Id: I97bc4b1c26cf055fd520e9bf2d49e52b14fe7515
BUG: 811217
Signed-off-by: Anand Avati &lt;avati@redhat.com&gt;
Reviewed-on: http://review.gluster.com/3485
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fuse, glusterfsd: mount logic fixes</title>
<updated>2012-05-27T16:55:47+00:00</updated>
<author>
<name>Csaba Henk</name>
<email>csaba@redhat.com</email>
</author>
<published>2012-05-14T11:37:28+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/commit/?id=4409b22a7a86431631f3fdf5a07d642e32735042'/>
<id>4409b22a7a86431631f3fdf5a07d642e32735042</id>
<content type='text'>
Commit 7d0397c2 introduced two issues:

 i) broke the libfuse derived mount logic (details below)
ii) in case of a daemonized glusterfs client is ran as daemon, parent
    process can return earlier than the mount is in place, which breaks
    agents that programmatically do a gluster mount via a direct call to
    glusterfs (ie. not via mount(8)).

This patch fixes these issues by a refactor that merges the approaches
sported by commits

  7d0397c2 fuse: allow requests during mount (needed for SELinux labels)
  c5d781e0 upon daemonizing, wait on mtab update to terminate in parent

Original daemonized libfuse event flow is as follows:

  try:
    fd = open("/dev/fuse")
    mount("-oopts,fd=%s" % fd ...)
    mount(8) -f    # manipulate mtab
  except:
    sp = socketpair()
    env _FUSE_COMMFD=sp fusermount -oopts
    fd = receive_fd(sp)

  where fusermount(1) does:
    fd = open("/dev/fuse")
    mount("-oopts,fd=%d" % fd ...)
    sp = atoi(getenv("_FUSE_COMMFD"))
    send_fd(sp, fd)

  daemonize(
    # in child
    fuse_loop(fd)
  )
  # in parent
  exit()

As of 013850c9 (instead of adopting FUSE's 47e61004¹), we went for async
mtab manipulation, and as of c5d781e0, still wanted keep that in sync
with termination of daemon parent, so we changed it to:

  try:
    fd = open("/dev/fuse")
    mount("-oopts,fd=%s" % fd ...)
    pid = fork(
      # in child
      mount(8) -f
    )
  except:
    sp = socketpair()
    env _FUSE_COMMFD=sp fusermount -oopts
    fd = receive_fd(sp)

  daemonize(
    fuse_loop(fd)
  )
  waitpid(pid)
  exit()

(Note the new approch came only to direct [privileged] mount, so fusermount
based mounting was already partially broken.)

As of 7d0397c2, with the purpose of facilitating async mount, the event flow
was practically reduced to:

  fd = open("/dev/fuse")
  fork(
    mount("-oopts,fd=%s" % fd ...)
    fork(
      mount(8) -n
    )
  )

  daemonize(
    fuse_loop(fd)
  )
  exit()

Thus fusermount based mounting become defunct; however, the dead
code was still kept around. So, we should either drop it or fix
it. Also, the mtab manipulator is forked into yet another child
with no purpose, while syncing with it in daemon parent is broken.
mount(2) is neither synced with parent.

Now we are coming to the following scheme:

  fd = open("/dev/fuse")
  pid = fork(
    try:
      mount("-oopts,fd=%s" % fd ...)
      mount(8) -n
    except:
      env _FUSE_DEVFD=fd fusermount -oopts
  )

  where fusermount(1) does:
    fd = getenv("_FUSE_DEVFD")
    mount("-oopts,fd=%s" % fd ...)

  daemonize(
    fuse_loop(fd)
  )
  waitpid(pid)
  exit()

Nb.:

- We can't help losing compatibility with upstream fusermount,
  as it sends back the fd only when mount(2) is completed,
  thus defeating the async mount approach. The
  'getenv("_FUSE_DEVFD")' mechanism is specfic to glusterfs'
  fusermount (at the moment -- sure we can talk about it with
  upstream)

- fusermount opens /dev/fuse at same privilege level as of
  original process², so we can bravely go on with doing the open
  unconditionally in original process

- Original mounting code actually tries to mount through
  fusermount _twice_: if first attempt fails, then, assuming
  subtype support is missing in kernel, it tries again subtype
  stripped. However, this is redundant, as fusermount internally
  also performs the subtype check³. Therefore we simplified the
  logic to have just a single fusermount call.

- we revert the changes to mount.glusterfs as of 7d0397c2, as
  now there is no issue with glusterfs to work around in that scope

¹ http://fuse.git.sourceforge.net/git/gitweb.cgi?p=fuse/fuse;a=blobdiff;f=ChangeLog;h=47e61004;hb=4c3d9b19;hpb=e61b775a
² http://fuse.git.sourceforge.net/git/gitweb.cgi?p=fuse/fuse;a=blob;f=util/fusermount.c;h=b2e87d95#l1023
³ http://fuse.git.sourceforge.net/git/gitweb.cgi?p=fuse/fuse;a=blob;f=util/fusermount.c;h=b2e87d95#l839

Change-Id: I0c4ab70e0c5ad7b27337228749b266bcd0ba941d
BUG: 811217
Signed-off-by: Csaba Henk &lt;csaba@redhat.com&gt;
Reviewed-on: http://review.gluster.com/3428
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Vijay Bellur &lt;vijay@gluster.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Commit 7d0397c2 introduced two issues:

 i) broke the libfuse derived mount logic (details below)
ii) in case of a daemonized glusterfs client is ran as daemon, parent
    process can return earlier than the mount is in place, which breaks
    agents that programmatically do a gluster mount via a direct call to
    glusterfs (ie. not via mount(8)).

This patch fixes these issues by a refactor that merges the approaches
sported by commits

  7d0397c2 fuse: allow requests during mount (needed for SELinux labels)
  c5d781e0 upon daemonizing, wait on mtab update to terminate in parent

Original daemonized libfuse event flow is as follows:

  try:
    fd = open("/dev/fuse")
    mount("-oopts,fd=%s" % fd ...)
    mount(8) -f    # manipulate mtab
  except:
    sp = socketpair()
    env _FUSE_COMMFD=sp fusermount -oopts
    fd = receive_fd(sp)

  where fusermount(1) does:
    fd = open("/dev/fuse")
    mount("-oopts,fd=%d" % fd ...)
    sp = atoi(getenv("_FUSE_COMMFD"))
    send_fd(sp, fd)

  daemonize(
    # in child
    fuse_loop(fd)
  )
  # in parent
  exit()

As of 013850c9 (instead of adopting FUSE's 47e61004¹), we went for async
mtab manipulation, and as of c5d781e0, still wanted keep that in sync
with termination of daemon parent, so we changed it to:

  try:
    fd = open("/dev/fuse")
    mount("-oopts,fd=%s" % fd ...)
    pid = fork(
      # in child
      mount(8) -f
    )
  except:
    sp = socketpair()
    env _FUSE_COMMFD=sp fusermount -oopts
    fd = receive_fd(sp)

  daemonize(
    fuse_loop(fd)
  )
  waitpid(pid)
  exit()

(Note the new approch came only to direct [privileged] mount, so fusermount
based mounting was already partially broken.)

As of 7d0397c2, with the purpose of facilitating async mount, the event flow
was practically reduced to:

  fd = open("/dev/fuse")
  fork(
    mount("-oopts,fd=%s" % fd ...)
    fork(
      mount(8) -n
    )
  )

  daemonize(
    fuse_loop(fd)
  )
  exit()

Thus fusermount based mounting become defunct; however, the dead
code was still kept around. So, we should either drop it or fix
it. Also, the mtab manipulator is forked into yet another child
with no purpose, while syncing with it in daemon parent is broken.
mount(2) is neither synced with parent.

Now we are coming to the following scheme:

  fd = open("/dev/fuse")
  pid = fork(
    try:
      mount("-oopts,fd=%s" % fd ...)
      mount(8) -n
    except:
      env _FUSE_DEVFD=fd fusermount -oopts
  )

  where fusermount(1) does:
    fd = getenv("_FUSE_DEVFD")
    mount("-oopts,fd=%s" % fd ...)

  daemonize(
    fuse_loop(fd)
  )
  waitpid(pid)
  exit()

Nb.:

- We can't help losing compatibility with upstream fusermount,
  as it sends back the fd only when mount(2) is completed,
  thus defeating the async mount approach. The
  'getenv("_FUSE_DEVFD")' mechanism is specfic to glusterfs'
  fusermount (at the moment -- sure we can talk about it with
  upstream)

- fusermount opens /dev/fuse at same privilege level as of
  original process², so we can bravely go on with doing the open
  unconditionally in original process

- Original mounting code actually tries to mount through
  fusermount _twice_: if first attempt fails, then, assuming
  subtype support is missing in kernel, it tries again subtype
  stripped. However, this is redundant, as fusermount internally
  also performs the subtype check³. Therefore we simplified the
  logic to have just a single fusermount call.

- we revert the changes to mount.glusterfs as of 7d0397c2, as
  now there is no issue with glusterfs to work around in that scope

¹ http://fuse.git.sourceforge.net/git/gitweb.cgi?p=fuse/fuse;a=blobdiff;f=ChangeLog;h=47e61004;hb=4c3d9b19;hpb=e61b775a
² http://fuse.git.sourceforge.net/git/gitweb.cgi?p=fuse/fuse;a=blob;f=util/fusermount.c;h=b2e87d95#l1023
³ http://fuse.git.sourceforge.net/git/gitweb.cgi?p=fuse/fuse;a=blob;f=util/fusermount.c;h=b2e87d95#l839

Change-Id: I0c4ab70e0c5ad7b27337228749b266bcd0ba941d
BUG: 811217
Signed-off-by: Csaba Henk &lt;csaba@redhat.com&gt;
Reviewed-on: http://review.gluster.com/3428
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Vijay Bellur &lt;vijay@gluster.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
