<feed xmlns='http://www.w3.org/2005/Atom'>
<title>glusterfs.git/contrib/fuse-util, branch v3.3.2qa2</title>
<subtitle></subtitle>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/'/>
<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>
<entry>
<title>fusermount: Build problem fixed with new glibc</title>
<updated>2011-11-11T05:27:03+00:00</updated>
<author>
<name>Harshavardhana</name>
<email>fharshav@redhat.com</email>
</author>
<published>2011-11-09T00:58:44+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/commit/?id=359eee148b2be5aaf9677f61f98b89a50d0f1b88'/>
<id>359eee148b2be5aaf9677f61f98b89a50d0f1b88</id>
<content type='text'>
Change-Id: Id25e688d3dbecb74d820388faec5ee5041f21630
BUG: 3797
Reviewed-on: http://review.gluster.com/714
Reviewed-by: Anand Avati &lt;avati@gluster.com&gt;
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change-Id: Id25e688d3dbecb74d820388faec5ee5041f21630
BUG: 3797
Reviewed-on: http://review.gluster.com/714
Reviewed-by: Anand Avati &lt;avati@gluster.com&gt;
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>contrib/fuse: update from upstream [555d6b50 in git://fuse.git.sourceforge.net/fuse/fuse]</title>
<updated>2010-10-01T10:41:29+00:00</updated>
<author>
<name>Csaba Henk</name>
<email>csaba@gluster.com</email>
</author>
<published>2010-09-30T12:44:26+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/commit/?id=55c6e672503a2451186e17b9c1b7daf6e3ae5463'/>
<id>55c6e672503a2451186e17b9c1b7daf6e3ae5463</id>
<content type='text'>
"""
commit 555d6b504308eac6b976321ce938ee4bec62c354
Author: Miklos Szeredi &lt;mszeredi@suse.cz&gt;
Date:   Tue Sep 28 10:13:24 2010 +0200

    Fix option escaping for fusermount.

    If the "fsname=" option contained a comma then the option parser in
    fusermount was confused (Novell bugzilla #641480).  Fix by escaping
    commas when passing them over to fusermount.

    Reported by Jan Engelhardt
"""

Signed-off-by: Csaba Henk &lt;csaba@gluster.com&gt;
Signed-off-by: Vijay Bellur &lt;vijay@dev.gluster.com&gt;

BUG: 1752 (sync with upstream for "Fix option escaping for fusermount.")
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1752
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
"""
commit 555d6b504308eac6b976321ce938ee4bec62c354
Author: Miklos Szeredi &lt;mszeredi@suse.cz&gt;
Date:   Tue Sep 28 10:13:24 2010 +0200

    Fix option escaping for fusermount.

    If the "fsname=" option contained a comma then the option parser in
    fusermount was confused (Novell bugzilla #641480).  Fix by escaping
    commas when passing them over to fusermount.

    Reported by Jan Engelhardt
"""

Signed-off-by: Csaba Henk &lt;csaba@gluster.com&gt;
Signed-off-by: Vijay Bellur &lt;vijay@dev.gluster.com&gt;

BUG: 1752 (sync with upstream for "Fix option escaping for fusermount.")
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1752
</pre>
</div>
</content>
</entry>
<entry>
<title>fusermount: bring in updates from upstream</title>
<updated>2010-04-30T06:10:15+00:00</updated>
<author>
<name>Csaba Henk</name>
<email>csaba@gluster.com</email>
</author>
<published>2010-04-28T01:37:39+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/commit/?id=b03a5683680b7be5ff7c88083276811a381aac68'/>
<id>b03a5683680b7be5ff7c88083276811a381aac68</id>
<content type='text'>
* Fix checking for symlinks in umount from /tmp.  Reported by Al
    Viro

    * Fix umounting if /tmp is a symlink.  Reported by Franco Broi

Signed-off-by: Csaba Henk &lt;csaba@gluster.com&gt;
Signed-off-by: Anand V. Avati &lt;avati@dev.gluster.com&gt;

BUG: 657 (Metabug for tracking fuse upstream)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=657
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Fix checking for symlinks in umount from /tmp.  Reported by Al
    Viro

    * Fix umounting if /tmp is a symlink.  Reported by Franco Broi

Signed-off-by: Csaba Henk &lt;csaba@gluster.com&gt;
Signed-off-by: Anand V. Avati &lt;avati@dev.gluster.com&gt;

BUG: 657 (Metabug for tracking fuse upstream)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=657
</pre>
</div>
</content>
</entry>
<entry>
<title>fuse: bring over recent mounting code changes from libfuse upstream</title>
<updated>2010-02-21T08:17:42+00:00</updated>
<author>
<name>Csaba Henk</name>
<email>csaba@gluster.com</email>
</author>
<published>2010-02-20T18:53:38+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/commit/?id=94d31fdaf967f0d224a2bfa7b275b0344e0f5700'/>
<id>94d31fdaf967f0d224a2bfa7b275b0344e0f5700</id>
<content type='text'>
Following commits were ported (commit ids as of
http://git.gluster.com/?p=users/csaba/fuse.git
repo):

commit 06fe3eb9c864b69bea98600c0a7eab7b63834735
Author: mszeredi &lt;mszeredi&gt;
Date:   Thu Feb 18 11:05:12 2010 +0000

    * Fix stack alignment for clone()

 ChangeLog               |    4 ++++
 include/fuse_lowlevel.h |    1 +
 util/fusermount.c       |    9 ++++-----
 3 files changed, 9 insertions(+), 5 deletions(-)

commit dfe1aab6520d70d72d36edf0508fef9a865daa5f
Author: mszeredi &lt;mszeredi&gt;
Date:   Tue Jan 26 18:20:12 2010 +0000

    * Fix race if two "fusermount -u" instances are run in parallel.
    Reported by Dan Rosenberg

    * Make sure that the path to be unmounted doesn't refer to a
    symlink

 ChangeLog         |    8 +
 lib/mount.c       |    2 +-
 lib/mount_util.c  |   31 +++--
 lib/mount_util.h  |    3 +-
 util/fusermount.c |  380 +++++++++++++++++++++++++++++++++++++++++++++--------
 5 files changed, 351 insertions(+), 73 deletions(-)

Signed-off-by: Csaba Henk &lt;csaba@gluster.com&gt;
Signed-off-by: Anand V. Avati &lt;avati@dev.gluster.com&gt;

BUG: 657 (Metabug for tracking fuse upstream)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=657
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Following commits were ported (commit ids as of
http://git.gluster.com/?p=users/csaba/fuse.git
repo):

commit 06fe3eb9c864b69bea98600c0a7eab7b63834735
Author: mszeredi &lt;mszeredi&gt;
Date:   Thu Feb 18 11:05:12 2010 +0000

    * Fix stack alignment for clone()

 ChangeLog               |    4 ++++
 include/fuse_lowlevel.h |    1 +
 util/fusermount.c       |    9 ++++-----
 3 files changed, 9 insertions(+), 5 deletions(-)

commit dfe1aab6520d70d72d36edf0508fef9a865daa5f
Author: mszeredi &lt;mszeredi&gt;
Date:   Tue Jan 26 18:20:12 2010 +0000

    * Fix race if two "fusermount -u" instances are run in parallel.
    Reported by Dan Rosenberg

    * Make sure that the path to be unmounted doesn't refer to a
    symlink

 ChangeLog         |    8 +
 lib/mount.c       |    2 +-
 lib/mount_util.c  |   31 +++--
 lib/mount_util.h  |    3 +-
 util/fusermount.c |  380 +++++++++++++++++++++++++++++++++++++++++++++--------
 5 files changed, 351 insertions(+), 73 deletions(-)

Signed-off-by: Csaba Henk &lt;csaba@gluster.com&gt;
Signed-off-by: Anand V. Avati &lt;avati@dev.gluster.com&gt;

BUG: 657 (Metabug for tracking fuse upstream)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=657
</pre>
</div>
</content>
</entry>
<entry>
<title>Do not abort make install if a chown on the fuser-mount script does not succeed.</title>
<updated>2009-11-04T07:54:06+00:00</updated>
<author>
<name>Pavan Sondur</name>
<email>pavan@gluster.com</email>
</author>
<published>2009-11-04T02:03:05+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/commit/?id=47da643a0e9d8786489fe3173de318732556b6f0'/>
<id>47da643a0e9d8786489fe3173de318732556b6f0</id>
<content type='text'>
Signed-off-by: Pavan Vilas Sondur &lt;pavan@gluster.com&gt;
Signed-off-by: Anand V. Avati &lt;avati@dev.gluster.com&gt;

BUG: 343 (Placeholder bug for adding volgen into rpm, bdb makefile changes, etc)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=343
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Pavan Vilas Sondur &lt;pavan@gluster.com&gt;
Signed-off-by: Anand V. Avati &lt;avati@dev.gluster.com&gt;

BUG: 343 (Placeholder bug for adding volgen into rpm, bdb makefile changes, etc)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=343
</pre>
</div>
</content>
</entry>
<entry>
<title>bring in fusermount</title>
<updated>2009-08-12T13:26:31+00:00</updated>
<author>
<name>Csaba Henk</name>
<email>csaba@gluster.com</email>
</author>
<published>2009-08-12T01:26:11+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/commit/?id=901ba842cd6c42ff24e0539a1b8231b3e802e1ce'/>
<id>901ba842cd6c42ff24e0539a1b8231b3e802e1ce</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
