<feed xmlns='http://www.w3.org/2005/Atom'>
<title>glusterfs.git/contrib/fuse-lib, branch v3.3.0qa44</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>fuse: allow requests during mount (needed for SELinux labels)</title>
<updated>2012-05-27T16:55:05+00:00</updated>
<author>
<name>Csaba Henk</name>
<email>csaba@redhat.com</email>
</author>
<published>2012-05-24T06:55:43+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/commit/?id=507a4ebb6ca3704e1a6ee3d1b6511b58ed9f6ba7'/>
<id>507a4ebb6ca3704e1a6ee3d1b6511b58ed9f6ba7</id>
<content type='text'>
Resurrecting Jeff's commit:

  commit 7d0397c2144810c8a396e00187a6617873c94002
  Author: Jeff Darcy &lt;jdarcy@redhat.com&gt;

      fuse: allow requests during mount (needed for SELinux labels)

that was reverted as of:

  commit 4ab1c326f3862714b960302f06c6323d6291b695
  Author: Vijay Bellur &lt;vijay@gluster.com&gt;

      Revert "fuse: allow requests during mount (needed for SELinux labels)"

BUG: 811217
Change-Id: Ia1af402897e6a7290acf79617c34fdc804751729
Signed-off-by: Csaba Henk &lt;csaba@redhat.com&gt;
Reviewed-on: http://review.gluster.com/3452
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>
Resurrecting Jeff's commit:

  commit 7d0397c2144810c8a396e00187a6617873c94002
  Author: Jeff Darcy &lt;jdarcy@redhat.com&gt;

      fuse: allow requests during mount (needed for SELinux labels)

that was reverted as of:

  commit 4ab1c326f3862714b960302f06c6323d6291b695
  Author: Vijay Bellur &lt;vijay@gluster.com&gt;

      Revert "fuse: allow requests during mount (needed for SELinux labels)"

BUG: 811217
Change-Id: Ia1af402897e6a7290acf79617c34fdc804751729
Signed-off-by: Csaba Henk &lt;csaba@redhat.com&gt;
Reviewed-on: http://review.gluster.com/3452
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>Revert "fuse: allow requests during mount (needed for SELinux labels)"</title>
<updated>2012-05-11T05:18:20+00:00</updated>
<author>
<name>Vijay Bellur</name>
<email>vijay@gluster.com</email>
</author>
<published>2012-05-11T05:18:20+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/commit/?id=4ab1c326f3862714b960302f06c6323d6291b695'/>
<id>4ab1c326f3862714b960302f06c6323d6291b695</id>
<content type='text'>
This reverts commit 7d0397c2144810c8a396e00187a6617873c94002.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 7d0397c2144810c8a396e00187a6617873c94002.
</pre>
</div>
</content>
</entry>
<entry>
<title>fuse: allow requests during mount (needed for SELinux labels)</title>
<updated>2012-04-23T21:37:24+00:00</updated>
<author>
<name>Jeff Darcy</name>
<email>jdarcy@redhat.com</email>
</author>
<published>2012-04-23T15:51:22+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/commit/?id=7d0397c2144810c8a396e00187a6617873c94002'/>
<id>7d0397c2144810c8a396e00187a6617873c94002</id>
<content type='text'>
Change-Id: Ia1af402897e6a7290acf79617c34fdc804751729
BUG: 811217
Signed-off-by: Jeff Darcy &lt;jdarcy@redhat.com&gt;
Reviewed-on: http://review.gluster.com/3199
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>
Change-Id: Ia1af402897e6a7290acf79617c34fdc804751729
BUG: 811217
Signed-off-by: Jeff Darcy &lt;jdarcy@redhat.com&gt;
Reviewed-on: http://review.gluster.com/3199
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>core: change lk-owner as a 1k buffer</title>
<updated>2012-01-25T04:14:17+00:00</updated>
<author>
<name>Amar Tumballi</name>
<email>amar@gluster.com</email>
</author>
<published>2012-01-16T23:58:51+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/commit/?id=b02afc6d008f9959db28244eb2b9dd3b9ef92393'/>
<id>b02afc6d008f9959db28244eb2b9dd3b9ef92393</id>
<content type='text'>
so, NLM can send the lk-owner field directly to the locks translators,
while doing the same effort, also enabled sending maximum of 500 aux gid
over protocol.

Change-Id: I87c2514392748416f7ffe21d5154faad2e413969
Signed-off-by: Amar Tumballi &lt;amar@gluster.com&gt;
BUG: 767229
Reviewed-on: http://review.gluster.com/779
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Anand Avati &lt;avati@gluster.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
so, NLM can send the lk-owner field directly to the locks translators,
while doing the same effort, also enabled sending maximum of 500 aux gid
over protocol.

Change-Id: I87c2514392748416f7ffe21d5154faad2e413969
Signed-off-by: Amar Tumballi &lt;amar@gluster.com&gt;
BUG: 767229
Reviewed-on: http://review.gluster.com/779
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Anand Avati &lt;avati@gluster.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>We must #include &lt;signal.h&gt; for sigprocmask(2). Failure to do so will break</title>
<updated>2011-11-24T07:49:46+00:00</updated>
<author>
<name>Emmanuel Dreyfus</name>
<email>manu@netbsd.org</email>
</author>
<published>2011-10-16T06:06:18+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/commit/?id=3f1092c1a79adefd4400bfb6fd20029a22b0f827'/>
<id>3f1092c1a79adefd4400bfb6fd20029a22b0f827</id>
<content type='text'>
on NetBSD kernel without COMPAT_13 option.

Change-Id: Ia710bbe31ed48e4df4cd47f99e335d7226b99173
BUG: 2923
Reviewed-on: http://review.gluster.com/594
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Jeff Darcy &lt;jdarcy@redhat.com&gt;
Reviewed-by: Anand Avati &lt;avati@gluster.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
on NetBSD kernel without COMPAT_13 option.

Change-Id: Ia710bbe31ed48e4df4cd47f99e335d7226b99173
BUG: 2923
Reviewed-on: http://review.gluster.com/594
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Jeff Darcy &lt;jdarcy@redhat.com&gt;
Reviewed-by: Anand Avati &lt;avati@gluster.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Use /bin/mount on Linux, /sbin/mount on other systems</title>
<updated>2011-11-24T07:48:09+00:00</updated>
<author>
<name>Emmanuel Dreyfus</name>
<email>manu@netbsd.org</email>
</author>
<published>2011-11-24T05:32:36+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/commit/?id=8b8459b5ee5d3bd2dbbf416e12a1be0cd90c270f'/>
<id>8b8459b5ee5d3bd2dbbf416e12a1be0cd90c270f</id>
<content type='text'>
Change-Id: I8d2e518d29cedb1fbfa77d0189a2d4a24957e662
BUG: 2923
Reviewed-on: http://review.gluster.com/752
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Amar Tumballi &lt;amar@gluster.com&gt;
Reviewed-by: Anand Avati &lt;avati@gluster.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change-Id: I8d2e518d29cedb1fbfa77d0189a2d4a24957e662
BUG: 2923
Reviewed-on: http://review.gluster.com/752
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Amar Tumballi &lt;amar@gluster.com&gt;
Reviewed-by: Anand Avati &lt;avati@gluster.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fuse: NetBSD portability fixes</title>
<updated>2011-05-30T11:48:34+00:00</updated>
<author>
<name>Anand Avati</name>
<email>avati@gluster.com</email>
</author>
<published>2011-05-30T04:18:00+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/commit/?id=291588c6d912e137ef4d8c19d0447e43c7d87bc4'/>
<id>291588c6d912e137ef4d8c19d0447e43c7d87bc4</id>
<content type='text'>
On NetBSD use libperfuse(3), rename umount2(2) as unmount(2), and skip
inexistant /etc/mtab management.

Thanks to: Emmanuel Dreyfus &lt;manu@netbsd.org&gt;

Signed-off-by: Anand Avati &lt;avati@gluster.com&gt;

BUG: 2923 (NetBSD port)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2923
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
On NetBSD use libperfuse(3), rename umount2(2) as unmount(2), and skip
inexistant /etc/mtab management.

Thanks to: Emmanuel Dreyfus &lt;manu@netbsd.org&gt;

Signed-off-by: Anand Avati &lt;avati@gluster.com&gt;

BUG: 2923 (NetBSD port)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2923
</pre>
</div>
</content>
</entry>
<entry>
<title>upon daemonizing, wait on mtab update to terminate in parent</title>
<updated>2011-05-19T22:41:47+00:00</updated>
<author>
<name>Csaba Henk</name>
<email>csaba@gluster.com</email>
</author>
<published>2011-05-15T04:52:33+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/commit/?id=c5d781e05599e9e7ad736d42c9c1033992c76ded'/>
<id>c5d781e05599e9e7ad736d42c9c1033992c76ded</id>
<content type='text'>
This fixes the race in between the mtab update attempts of mount and umount
when we do a lazy umount right after mounting, in order to hide the given fs
instance; yet this way we still avoid the deadlock of the fs and mount which
we can hit if we wait unconditionally for the mtab update to terminate (cf.
bz #511).

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

BUG: 2690 (race between mtab updates of mount and umount)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2690
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This fixes the race in between the mtab update attempts of mount and umount
when we do a lazy umount right after mounting, in order to hide the given fs
instance; yet this way we still avoid the deadlock of the fs and mount which
we can hit if we wait unconditionally for the mtab update to terminate (cf.
bz #511).

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

BUG: 2690 (race between mtab updates of mount and umount)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2690
</pre>
</div>
</content>
</entry>
<entry>
<title>build fixes</title>
<updated>2011-04-12T06:50:28+00:00</updated>
<author>
<name>Venky Shankar</name>
<email>venky@gluster.com</email>
</author>
<published>2011-04-11T05:48:36+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/commit/?id=2a6598646824da9d6a957fb5b3e4c6bb40fb6835'/>
<id>2a6598646824da9d6a957fb5b3e4c6bb40fb6835</id>
<content type='text'>
Signed-off-by: Venky Shankar &lt;venky@gluster.com&gt;
Signed-off-by: Anand Avati &lt;avati@gluster.com&gt;

BUG: 2550 (build warnings)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2550
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Venky Shankar &lt;venky@gluster.com&gt;
Signed-off-by: Anand Avati &lt;avati@gluster.com&gt;

BUG: 2550 (build warnings)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2550
</pre>
</div>
</content>
</entry>
</feed>
