<feed xmlns='http://www.w3.org/2005/Atom'>
<title>glusterfs.git/api/src, branch v3.8.5</title>
<subtitle></subtitle>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/'/>
<entry>
<title>gfapi: Fix few fd ref leaks</title>
<updated>2016-09-30T12:44:56+00:00</updated>
<author>
<name>Soumya Koduri</name>
<email>skoduri@redhat.com</email>
</author>
<published>2016-09-26T09:24:27+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/commit/?id=7a50690e8939d1f806556ece1bad9fc2a81c3b80'/>
<id>7a50690e8939d1f806556ece1bad9fc2a81c3b80</id>
<content type='text'>
From the code inspection, have observed that there are fd ref
leaks for few fd-based gfapi fops. 'glfs_resolve_fd' returns
a fd (either existing or migrated) with an extra ref taken.
This needs to be unref'ed at the end of the operation.

Mainline reference:
&gt; Change-Id: Id63394e3e7deafb0c8b06444f2ae847248b126db
&gt; BUG: 1379285
&gt; Signed-off-by: Soumya Koduri &lt;skoduri@redhat.com&gt;
&gt; Reviewed-on: http://review.gluster.org/15573
&gt; Reviewed-by: Niels de Vos &lt;ndevos@redhat.com&gt;
(cherry picked from commit d27cffab670858d7812bbb458a0833303d009b3b)

Change-Id: I0919abbddb618d08aaf77b2ce1173eec18b382f1
BUG: 1379708
Signed-off-by: Soumya Koduri &lt;skoduri@redhat.com&gt;
Reviewed-on: http://review.gluster.org/15585
Smoke: Gluster Build System &lt;jenkins@build.gluster.org&gt;
NetBSD-regression: NetBSD Build System &lt;jenkins@build.gluster.org&gt;
CentOS-regression: Gluster Build System &lt;jenkins@build.gluster.org&gt;
Reviewed-by: Niels de Vos &lt;ndevos@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
From the code inspection, have observed that there are fd ref
leaks for few fd-based gfapi fops. 'glfs_resolve_fd' returns
a fd (either existing or migrated) with an extra ref taken.
This needs to be unref'ed at the end of the operation.

Mainline reference:
&gt; Change-Id: Id63394e3e7deafb0c8b06444f2ae847248b126db
&gt; BUG: 1379285
&gt; Signed-off-by: Soumya Koduri &lt;skoduri@redhat.com&gt;
&gt; Reviewed-on: http://review.gluster.org/15573
&gt; Reviewed-by: Niels de Vos &lt;ndevos@redhat.com&gt;
(cherry picked from commit d27cffab670858d7812bbb458a0833303d009b3b)

Change-Id: I0919abbddb618d08aaf77b2ce1173eec18b382f1
BUG: 1379708
Signed-off-by: Soumya Koduri &lt;skoduri@redhat.com&gt;
Reviewed-on: http://review.gluster.org/15585
Smoke: Gluster Build System &lt;jenkins@build.gluster.org&gt;
NetBSD-regression: NetBSD Build System &lt;jenkins@build.gluster.org&gt;
CentOS-regression: Gluster Build System &lt;jenkins@build.gluster.org&gt;
Reviewed-by: Niels de Vos &lt;ndevos@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tests: Enable all gfapi test cases</title>
<updated>2016-09-21T10:18:32+00:00</updated>
<author>
<name>Rajesh Joseph</name>
<email>rjoseph@redhat.com</email>
</author>
<published>2016-09-14T00:38:39+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/commit/?id=d4e16452c82fcf6a71292aa91f5d7424a31b7b0f'/>
<id>d4e16452c82fcf6a71292aa91f5d7424a31b7b0f</id>
<content type='text'>
&gt; Change-Id: I32bfec4af91348d96dc3e81a9d5c9cad599f821b
&gt; Bug: 1358594
&gt; Signed-off-by: Poornima G &lt;pgurusid@redhat.com&gt;
&gt; Reviewed-on: http://review.gluster.org/14748
&gt; NetBSD-regression: NetBSD Build System &lt;jenkins@build.gluster.org&gt;
&gt; CentOS-regression: Gluster Build System &lt;jenkins@build.gluster.org&gt;
&gt; Smoke: Gluster Build System &lt;jenkins@build.gluster.org&gt;
&gt; Reviewed-by: Raghavendra Talur &lt;rtalur@redhat.com&gt;

Bug: 1375990
Change-Id: I87f6c7d20959e2d4bbe8c064767a9fed004e8c4a
Signed-off-by: Rajesh Joseph &lt;rjoseph@redhat.com&gt;
Reviewed-on: http://review.gluster.org/15499
NetBSD-regression: NetBSD Build System &lt;jenkins@build.gluster.org&gt;
CentOS-regression: Gluster Build System &lt;jenkins@build.gluster.org&gt;
Smoke: Gluster Build System &lt;jenkins@build.gluster.org&gt;
Reviewed-by: Raghavendra Talur &lt;rtalur@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
&gt; Change-Id: I32bfec4af91348d96dc3e81a9d5c9cad599f821b
&gt; Bug: 1358594
&gt; Signed-off-by: Poornima G &lt;pgurusid@redhat.com&gt;
&gt; Reviewed-on: http://review.gluster.org/14748
&gt; NetBSD-regression: NetBSD Build System &lt;jenkins@build.gluster.org&gt;
&gt; CentOS-regression: Gluster Build System &lt;jenkins@build.gluster.org&gt;
&gt; Smoke: Gluster Build System &lt;jenkins@build.gluster.org&gt;
&gt; Reviewed-by: Raghavendra Talur &lt;rtalur@redhat.com&gt;

Bug: 1375990
Change-Id: I87f6c7d20959e2d4bbe8c064767a9fed004e8c4a
Signed-off-by: Rajesh Joseph &lt;rjoseph@redhat.com&gt;
Reviewed-on: http://review.gluster.org/15499
NetBSD-regression: NetBSD Build System &lt;jenkins@build.gluster.org&gt;
CentOS-regression: Gluster Build System &lt;jenkins@build.gluster.org&gt;
Smoke: Gluster Build System &lt;jenkins@build.gluster.org&gt;
Reviewed-by: Raghavendra Talur &lt;rtalur@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>gfapi: SSL connection for mgmt connection is not working</title>
<updated>2016-08-31T21:23:14+00:00</updated>
<author>
<name>Rajesh Joseph</name>
<email>rjoseph@redhat.com</email>
</author>
<published>2016-08-02T15:33:34+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/commit/?id=ecb8d38d34c6cdd16e34bbe40d3e64e9d1cc9909'/>
<id>ecb8d38d34c6cdd16e34bbe40d3e64e9d1cc9909</id>
<content type='text'>
Problem: libgfapi does not enable SSL on mgmt connection.

Fix: Enable SSL when it is enabled on mgmt connection is enabled,
i.e. presence of /var/lib/glusterd/secure-access file

&gt; Change-Id: I1ce4935b04e6140aeab819e42076defd580b0727
&gt; BUG: 1362602
&gt; Signed-off-by: Rajesh Joseph &lt;rjoseph@redhat.com&gt;
&gt; Reviewed-on: http://review.gluster.org/15073
&gt; Smoke: Gluster Build System &lt;jenkins@build.gluster.org&gt;
&gt; NetBSD-regression: NetBSD Build System &lt;jenkins@build.gluster.org&gt;
&gt; CentOS-regression: Gluster Build System &lt;jenkins@build.gluster.org&gt;
&gt; Reviewed-by: Niels de Vos &lt;ndevos@redhat.com&gt;
&gt; Reviewed-by: Kaushal M &lt;kaushal@redhat.com&gt;
(cherry picked from commit 62f4e41e9eafd2838d2a11989f08b0e7627284b4)

Change-Id: I282729825229e961f03b7f8e8a9fa0aa2c8fc6a7
BUG: 1371650
Signed-off-by: Rajesh Joseph &lt;rjoseph@redhat.com&gt;
Reviewed-on: http://review.gluster.org/15361
NetBSD-regression: NetBSD Build System &lt;jenkins@build.gluster.org&gt;
Smoke: Gluster Build System &lt;jenkins@build.gluster.org&gt;
CentOS-regression: Gluster Build System &lt;jenkins@build.gluster.org&gt;
Reviewed-by: Jeff Darcy &lt;jdarcy@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem: libgfapi does not enable SSL on mgmt connection.

Fix: Enable SSL when it is enabled on mgmt connection is enabled,
i.e. presence of /var/lib/glusterd/secure-access file

&gt; Change-Id: I1ce4935b04e6140aeab819e42076defd580b0727
&gt; BUG: 1362602
&gt; Signed-off-by: Rajesh Joseph &lt;rjoseph@redhat.com&gt;
&gt; Reviewed-on: http://review.gluster.org/15073
&gt; Smoke: Gluster Build System &lt;jenkins@build.gluster.org&gt;
&gt; NetBSD-regression: NetBSD Build System &lt;jenkins@build.gluster.org&gt;
&gt; CentOS-regression: Gluster Build System &lt;jenkins@build.gluster.org&gt;
&gt; Reviewed-by: Niels de Vos &lt;ndevos@redhat.com&gt;
&gt; Reviewed-by: Kaushal M &lt;kaushal@redhat.com&gt;
(cherry picked from commit 62f4e41e9eafd2838d2a11989f08b0e7627284b4)

Change-Id: I282729825229e961f03b7f8e8a9fa0aa2c8fc6a7
BUG: 1371650
Signed-off-by: Rajesh Joseph &lt;rjoseph@redhat.com&gt;
Reviewed-on: http://review.gluster.org/15361
NetBSD-regression: NetBSD Build System &lt;jenkins@build.gluster.org&gt;
Smoke: Gluster Build System &lt;jenkins@build.gluster.org&gt;
CentOS-regression: Gluster Build System &lt;jenkins@build.gluster.org&gt;
Reviewed-by: Jeff Darcy &lt;jdarcy@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>gfapi: do not cache upcalls if the application is not interested</title>
<updated>2016-08-31T07:38:16+00:00</updated>
<author>
<name>Niels de Vos</name>
<email>ndevos@redhat.com</email>
</author>
<published>2016-08-30T08:23:55+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/commit/?id=3eecd4e2b5a923d7a5da1b899b6f0009e319b98d'/>
<id>3eecd4e2b5a923d7a5da1b899b6f0009e319b98d</id>
<content type='text'>
When the volume option 'features.cache-invalidation' is enabled, upcall
events are sent from the brick process to the client. Even if the client
is not interested in upcall events itself, md-cache or other xlators may
benefit from them.

By adding a new 'cache_upcalls' boolean in the 'struct glfs', we can
enable the caching of upcalls when the application called
glfs_h_poll_upcall(). NFS-Ganesha sets up a thread for handling upcalls
in the initialization phase, and calls glfs_h_poll_upcall() before any
NFS-client accesses the NFS-export.

In the future there will be a more flexible registration API for
enabling certain kind of upcall events. Until that is available, this
should work just fine.

Verificatio of this change is not trivial within our current regression
test framework. The bug report contains a description on how to reliably
reproduce the problem with the glusterfs-coreutils.

Cherry picked from commit 218c9b033fa44eacbc27d87491abd830548b362e:
&gt; Change-Id: I818595c92db50e6e48f7bfe287ee05103a4a30a2
&gt; BUG: 1368842
&gt; Signed-off-by: Niels de Vos &lt;ndevos@redhat.com&gt;
&gt; Reviewed-on: http://review.gluster.org/15191
&gt; Smoke: Gluster Build System &lt;jenkins@build.gluster.org&gt;
&gt; Reviewed-by: Poornima G &lt;pgurusid@redhat.com&gt;
&gt; NetBSD-regression: NetBSD Build System &lt;jenkins@build.gluster.org&gt;
&gt; CentOS-regression: Gluster Build System &lt;jenkins@build.gluster.org&gt;
&gt; Reviewed-by: soumya k &lt;skoduri@redhat.com&gt;
&gt; Reviewed-by: Kaleb KEITHLEY &lt;kkeithle@redhat.com&gt;

Change-Id: I818595c92db50e6e48f7bfe287ee05103a4a30a2
BUG: 1368841
Signed-off-by: Niels de Vos &lt;ndevos@redhat.com&gt;
Reviewed-on: http://review.gluster.org/15346
Smoke: Gluster Build System &lt;jenkins@build.gluster.org&gt;
NetBSD-regression: NetBSD Build System &lt;jenkins@build.gluster.org&gt;
CentOS-regression: Gluster Build System &lt;jenkins@build.gluster.org&gt;
Reviewed-by: soumya k &lt;skoduri@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When the volume option 'features.cache-invalidation' is enabled, upcall
events are sent from the brick process to the client. Even if the client
is not interested in upcall events itself, md-cache or other xlators may
benefit from them.

By adding a new 'cache_upcalls' boolean in the 'struct glfs', we can
enable the caching of upcalls when the application called
glfs_h_poll_upcall(). NFS-Ganesha sets up a thread for handling upcalls
in the initialization phase, and calls glfs_h_poll_upcall() before any
NFS-client accesses the NFS-export.

In the future there will be a more flexible registration API for
enabling certain kind of upcall events. Until that is available, this
should work just fine.

Verificatio of this change is not trivial within our current regression
test framework. The bug report contains a description on how to reliably
reproduce the problem with the glusterfs-coreutils.

Cherry picked from commit 218c9b033fa44eacbc27d87491abd830548b362e:
&gt; Change-Id: I818595c92db50e6e48f7bfe287ee05103a4a30a2
&gt; BUG: 1368842
&gt; Signed-off-by: Niels de Vos &lt;ndevos@redhat.com&gt;
&gt; Reviewed-on: http://review.gluster.org/15191
&gt; Smoke: Gluster Build System &lt;jenkins@build.gluster.org&gt;
&gt; Reviewed-by: Poornima G &lt;pgurusid@redhat.com&gt;
&gt; NetBSD-regression: NetBSD Build System &lt;jenkins@build.gluster.org&gt;
&gt; CentOS-regression: Gluster Build System &lt;jenkins@build.gluster.org&gt;
&gt; Reviewed-by: soumya k &lt;skoduri@redhat.com&gt;
&gt; Reviewed-by: Kaleb KEITHLEY &lt;kkeithle@redhat.com&gt;

Change-Id: I818595c92db50e6e48f7bfe287ee05103a4a30a2
BUG: 1368841
Signed-off-by: Niels de Vos &lt;ndevos@redhat.com&gt;
Reviewed-on: http://review.gluster.org/15346
Smoke: Gluster Build System &lt;jenkins@build.gluster.org&gt;
NetBSD-regression: NetBSD Build System &lt;jenkins@build.gluster.org&gt;
CentOS-regression: Gluster Build System &lt;jenkins@build.gluster.org&gt;
Reviewed-by: soumya k &lt;skoduri@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>gfapi: add missing glfs_truncate</title>
<updated>2016-08-12T11:19:56+00:00</updated>
<author>
<name>Jeff Darcy</name>
<email>jdarcy@redhat.com</email>
</author>
<published>2016-08-09T10:20:26+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/commit/?id=4ede257b2adc9dfc7cc4e368a1c1ab4149192839'/>
<id>4ede257b2adc9dfc7cc4e368a1c1ab4149192839</id>
<content type='text'>
&gt; Reviewed-on: http://review.gluster.org/13927
&gt; Smoke: Gluster Build System &lt;jenkins@build.gluster.org&gt;
&gt; CentOS-regression: Gluster Build System &lt;jenkins@build.gluster.org&gt;
&gt; NetBSD-regression: NetBSD Build System &lt;jenkins@build.gluster.org&gt;
&gt; Reviewed-by: Kaleb KEITHLEY &lt;kkeithle@redhat.com&gt;

BUG: 1366281
Change-Id: I80b016090a4d9d86278a0a5144dd58c0cbfe9bb2
Signed-off-by: Jeff Darcy &lt;jdarcy@redhat.com&gt;
Signed-off-by: Oleksandr Natalenko &lt;oleksandr@natalenko.name&gt;
Reviewed-on: http://review.gluster.org/15149
Smoke: Gluster Build System &lt;jenkins@build.gluster.org&gt;
NetBSD-regression: NetBSD Build System &lt;jenkins@build.gluster.org&gt;
CentOS-regression: Gluster Build System &lt;jenkins@build.gluster.org&gt;
Reviewed-by: Kaleb KEITHLEY &lt;kkeithle@redhat.com&gt;
Reviewed-by: Prashanth Pai &lt;ppai@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
&gt; Reviewed-on: http://review.gluster.org/13927
&gt; Smoke: Gluster Build System &lt;jenkins@build.gluster.org&gt;
&gt; CentOS-regression: Gluster Build System &lt;jenkins@build.gluster.org&gt;
&gt; NetBSD-regression: NetBSD Build System &lt;jenkins@build.gluster.org&gt;
&gt; Reviewed-by: Kaleb KEITHLEY &lt;kkeithle@redhat.com&gt;

BUG: 1366281
Change-Id: I80b016090a4d9d86278a0a5144dd58c0cbfe9bb2
Signed-off-by: Jeff Darcy &lt;jdarcy@redhat.com&gt;
Signed-off-by: Oleksandr Natalenko &lt;oleksandr@natalenko.name&gt;
Reviewed-on: http://review.gluster.org/15149
Smoke: Gluster Build System &lt;jenkins@build.gluster.org&gt;
NetBSD-regression: NetBSD Build System &lt;jenkins@build.gluster.org&gt;
CentOS-regression: Gluster Build System &lt;jenkins@build.gluster.org&gt;
Reviewed-by: Kaleb KEITHLEY &lt;kkeithle@redhat.com&gt;
Reviewed-by: Prashanth Pai &lt;ppai@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>gfapi: use const qualifier for glfs_*timens()</title>
<updated>2016-08-12T11:19:42+00:00</updated>
<author>
<name>Oleksandr Natalenko</name>
<email>oleksandr@natalenko.name</email>
</author>
<published>2016-08-09T11:58:08+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/commit/?id=4824f19e66d4fad4d41082fda398867aae5ef8a6'/>
<id>4824f19e66d4fad4d41082fda398867aae5ef8a6</id>
<content type='text'>
glfs_*timens() functions have the last argument
of struct timespec type that is supposed to be
const. Now using glfs_*timens() in fops, implemented
on top of FUSE library, leads to compiler-time warning
about discarding const qualifier.

Introducing const qualifier does not break ABI,
so let's just fix it.

&gt; Reviewed-on: http://review.gluster.org/15119
&gt; Smoke: Gluster Build System &lt;jenkins@build.gluster.org&gt;
&gt; CentOS-regression: Gluster Build System &lt;jenkins@build.gluster.org&gt;
&gt; NetBSD-regression: NetBSD Build System &lt;jenkins@build.gluster.org&gt;
&gt; Reviewed-by: Niels de Vos &lt;ndevos@redhat.com&gt;

BUG: 1365864
Change-Id: Iea2a1018de7dce67f67a8229671a5978246de800
Signed-off-by: Oleksandr Natalenko &lt;oleksandr@natalenko.name&gt;
Reviewed-on: http://review.gluster.org/15136
Smoke: Gluster Build System &lt;jenkins@build.gluster.org&gt;
CentOS-regression: Gluster Build System &lt;jenkins@build.gluster.org&gt;
Reviewed-by: Kaleb KEITHLEY &lt;kkeithle@redhat.com&gt;
NetBSD-regression: NetBSD Build System &lt;jenkins@build.gluster.org&gt;
Reviewed-by: Prashanth Pai &lt;ppai@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
glfs_*timens() functions have the last argument
of struct timespec type that is supposed to be
const. Now using glfs_*timens() in fops, implemented
on top of FUSE library, leads to compiler-time warning
about discarding const qualifier.

Introducing const qualifier does not break ABI,
so let's just fix it.

&gt; Reviewed-on: http://review.gluster.org/15119
&gt; Smoke: Gluster Build System &lt;jenkins@build.gluster.org&gt;
&gt; CentOS-regression: Gluster Build System &lt;jenkins@build.gluster.org&gt;
&gt; NetBSD-regression: NetBSD Build System &lt;jenkins@build.gluster.org&gt;
&gt; Reviewed-by: Niels de Vos &lt;ndevos@redhat.com&gt;

BUG: 1365864
Change-Id: Iea2a1018de7dce67f67a8229671a5978246de800
Signed-off-by: Oleksandr Natalenko &lt;oleksandr@natalenko.name&gt;
Reviewed-on: http://review.gluster.org/15136
Smoke: Gluster Build System &lt;jenkins@build.gluster.org&gt;
CentOS-regression: Gluster Build System &lt;jenkins@build.gluster.org&gt;
Reviewed-by: Kaleb KEITHLEY &lt;kkeithle@redhat.com&gt;
NetBSD-regression: NetBSD Build System &lt;jenkins@build.gluster.org&gt;
Reviewed-by: Prashanth Pai &lt;ppai@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>gfapi: Fix IO error caused when there is consecutive graph switches</title>
<updated>2016-08-11T08:35:17+00:00</updated>
<author>
<name>Poornima G</name>
<email>pgurusid@redhat.com</email>
</author>
<published>2016-07-19T09:50:09+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/commit/?id=26a0b60a01cebda3e88406dd8e13b1b9ed136108'/>
<id>26a0b60a01cebda3e88406dd8e13b1b9ed136108</id>
<content type='text'>
Backport of http://review.gluster.org/#/c/14722/

This is part 2 of the fix, the part 1 can be found at:
http://review.gluster.org/#/c/14656/

Problem:
=======
Consider a race between, __glfs_active_subvol() and graph_setup().
Lets say @TIME T1:
fs-&gt;active_subvol = A
fs-&gt;next_subvol = B
__glfs_active_subvol()                //under lock fs-&gt;mutex
{
  ....
  new_subvol = fs-&gt;next_subvol       //which is B
  ....                               //Start migration from A to B
  __glfs_first_lookup(){
     ....
     unlock fs-&gt;mutex                //@TIME T2
     network fop
     lock fs-&gt;mutex
     ....
  }
  ....                                //migration continue on B
  fs-&gt;active_subvol = fs-&gt;next_subvol //which is C (explained below)
  ....
}

@Time T2, lets say in another thread, graph_setup() is called with C,
note that at T2, fs-&gt;mutex is unlocked.

graph_stup(C...)
{
  lock fs-&gt;mutex
  ....
  if (fs-&gt;next_subvol)                // which is B
      destroy subvol (fs-&gt;next_subvol)
  ....
  fs-&gt;next_subvol = C
  ....
  unlock fs-&gt;mutex
}

Thus at the end of this,
fs-&gt;old_subvol = A;
fs-&gt;active_subvol = C;
fs-&gt;next_subvol = NULL;
which is wrong, as B completed migration, but was destroyed by
graph_setup, and C never was migrated.

Solution:
=========
Any new graph can be in one of the 2 states:
- Picked for migration, migration in progress (fs-&gt;mip_subvol)
- Not picked so far for migration (fs-&gt;next_subvol)
graph_setup() updates fs-&gt;next_subvol only, __glfs_active_subvol()
moves fs-&gt;next_subvol to fs-&gt;mip_subvol and fs-&gt;next_subvol = NULL
atomically, and then once the migration is complete, make that the
fs-&gt;active_subvol

Change-Id: Ib6ff0565105c5eedb912a43da4017cd413243612
BUG: 1365821
Signed-off-by: Poornima G &lt;pgurusid@redhat.com&gt;
Reviewed-on: http://review.gluster.org/15134
Smoke: Gluster Build System &lt;jenkins@build.gluster.org&gt;
CentOS-regression: Gluster Build System &lt;jenkins@build.gluster.org&gt;
NetBSD-regression: NetBSD Build System &lt;jenkins@build.gluster.org&gt;
Reviewed-by: Rajesh Joseph &lt;rjoseph@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Backport of http://review.gluster.org/#/c/14722/

This is part 2 of the fix, the part 1 can be found at:
http://review.gluster.org/#/c/14656/

Problem:
=======
Consider a race between, __glfs_active_subvol() and graph_setup().
Lets say @TIME T1:
fs-&gt;active_subvol = A
fs-&gt;next_subvol = B
__glfs_active_subvol()                //under lock fs-&gt;mutex
{
  ....
  new_subvol = fs-&gt;next_subvol       //which is B
  ....                               //Start migration from A to B
  __glfs_first_lookup(){
     ....
     unlock fs-&gt;mutex                //@TIME T2
     network fop
     lock fs-&gt;mutex
     ....
  }
  ....                                //migration continue on B
  fs-&gt;active_subvol = fs-&gt;next_subvol //which is C (explained below)
  ....
}

@Time T2, lets say in another thread, graph_setup() is called with C,
note that at T2, fs-&gt;mutex is unlocked.

graph_stup(C...)
{
  lock fs-&gt;mutex
  ....
  if (fs-&gt;next_subvol)                // which is B
      destroy subvol (fs-&gt;next_subvol)
  ....
  fs-&gt;next_subvol = C
  ....
  unlock fs-&gt;mutex
}

Thus at the end of this,
fs-&gt;old_subvol = A;
fs-&gt;active_subvol = C;
fs-&gt;next_subvol = NULL;
which is wrong, as B completed migration, but was destroyed by
graph_setup, and C never was migrated.

Solution:
=========
Any new graph can be in one of the 2 states:
- Picked for migration, migration in progress (fs-&gt;mip_subvol)
- Not picked so far for migration (fs-&gt;next_subvol)
graph_setup() updates fs-&gt;next_subvol only, __glfs_active_subvol()
moves fs-&gt;next_subvol to fs-&gt;mip_subvol and fs-&gt;next_subvol = NULL
atomically, and then once the migration is complete, make that the
fs-&gt;active_subvol

Change-Id: Ib6ff0565105c5eedb912a43da4017cd413243612
BUG: 1365821
Signed-off-by: Poornima G &lt;pgurusid@redhat.com&gt;
Reviewed-on: http://review.gluster.org/15134
Smoke: Gluster Build System &lt;jenkins@build.gluster.org&gt;
CentOS-regression: Gluster Build System &lt;jenkins@build.gluster.org&gt;
NetBSD-regression: NetBSD Build System &lt;jenkins@build.gluster.org&gt;
Reviewed-by: Rajesh Joseph &lt;rjoseph@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>glfs/upcall: entries should be removed under mutex lock</title>
<updated>2016-08-03T09:26:33+00:00</updated>
<author>
<name>Soumya Koduri</name>
<email>skoduri@redhat.com</email>
</author>
<published>2016-07-21T06:44:27+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/commit/?id=d64347d286b256e631b34b77c82216c0f122da42'/>
<id>d64347d286b256e631b34b77c82216c0f122da42</id>
<content type='text'>
During poll, upcall entries should be removed from the
upcall_list only under upcall_list_mutex lock. Otherwise
it could result in the list corruption if there are entries
being added during poll resulting in memory leak.

Also addressed a probable leak during any failures with upcall
entry addition.

This is backport of below master patch -
   http://review.gluster.org/14972

&gt;Change-Id: I468183f961eb6faed9a0a1bcb783705f711641fc
&gt;BUG: 1358608
&gt;Signed-off-by: Soumya Koduri &lt;skoduri@redhat.com&gt;
&gt;Reviewed-on: http://review.gluster.org/14972
&gt;Reviewed-by: Shyamsundar Ranganathan &lt;srangana@redhat.com&gt;
&gt;Reviewed-by: Jeff Darcy &lt;jdarcy@redhat.com&gt;
&gt;(cherry picked from commit 89dee8b46e126bc1d7541da90fa60844aa83451e)

Change-Id: I8f83175c7b550d8674dda5030168d5b94ccdd04c
BUG: 1361665
Signed-off-by: Soumya Koduri &lt;skoduri@redhat.com&gt;
Reviewed-on: http://review.gluster.org/15048
NetBSD-regression: NetBSD Build System &lt;jenkins@build.gluster.org&gt;
Reviewed-by: Niels de Vos &lt;ndevos@redhat.com&gt;
Smoke: Gluster Build System &lt;jenkins@build.gluster.org&gt;
Reviewed-by: jiffin tony Thottan &lt;jthottan@redhat.com&gt;
CentOS-regression: Gluster Build System &lt;jenkins@build.gluster.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
During poll, upcall entries should be removed from the
upcall_list only under upcall_list_mutex lock. Otherwise
it could result in the list corruption if there are entries
being added during poll resulting in memory leak.

Also addressed a probable leak during any failures with upcall
entry addition.

This is backport of below master patch -
   http://review.gluster.org/14972

&gt;Change-Id: I468183f961eb6faed9a0a1bcb783705f711641fc
&gt;BUG: 1358608
&gt;Signed-off-by: Soumya Koduri &lt;skoduri@redhat.com&gt;
&gt;Reviewed-on: http://review.gluster.org/14972
&gt;Reviewed-by: Shyamsundar Ranganathan &lt;srangana@redhat.com&gt;
&gt;Reviewed-by: Jeff Darcy &lt;jdarcy@redhat.com&gt;
&gt;(cherry picked from commit 89dee8b46e126bc1d7541da90fa60844aa83451e)

Change-Id: I8f83175c7b550d8674dda5030168d5b94ccdd04c
BUG: 1361665
Signed-off-by: Soumya Koduri &lt;skoduri@redhat.com&gt;
Reviewed-on: http://review.gluster.org/15048
NetBSD-regression: NetBSD Build System &lt;jenkins@build.gluster.org&gt;
Reviewed-by: Niels de Vos &lt;ndevos@redhat.com&gt;
Smoke: Gluster Build System &lt;jenkins@build.gluster.org&gt;
Reviewed-by: jiffin tony Thottan &lt;jthottan@redhat.com&gt;
CentOS-regression: Gluster Build System &lt;jenkins@build.gluster.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>gfapi/upcall: Fix a ref leak</title>
<updated>2016-08-01T09:01:17+00:00</updated>
<author>
<name>Soumya Koduri</name>
<email>skoduri@redhat.com</email>
</author>
<published>2016-07-22T07:45:58+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/commit/?id=56ed983c2d4cbfaffefb404e21db766007629400'/>
<id>56ed983c2d4cbfaffefb404e21db766007629400</id>
<content type='text'>
inode_find (used to create the handle) takes a reference
of the inode. This needs to be un'refernced to avoid leak.

This is backport of below master patch -
   http://review.gluster.org/14984

&gt;Change-Id: I22f03577a8f1d9608cfc62d57202cfc4c2ba12b3
&gt;BUG: 1358608
&gt;Signed-off-by: Soumya Koduri &lt;skoduri@redhat.com&gt;
&gt;Reviewed-on: http://review.gluster.org/14984
&gt;Reviewed-by: jiffin tony Thottan &lt;jthottan@redhat.com&gt;
&gt;Reviewed-by: Jeff Darcy &lt;jdarcy@redhat.com&gt;
&gt;(cherry picked from commit bb48eb46910085928efbd7fb491c5b2db25bba98)

Change-Id: I92701af8a948d982fd4dbe31af32334c1bb26347
BUG: 1361665
Signed-off-by: Soumya Koduri &lt;skoduri@redhat.com&gt;
Reviewed-on: http://review.gluster.org/15049
NetBSD-regression: NetBSD Build System &lt;jenkins@build.gluster.org&gt;
CentOS-regression: Gluster Build System &lt;jenkins@build.gluster.org&gt;
Reviewed-by: Niels de Vos &lt;ndevos@redhat.com&gt;
Smoke: Gluster Build System &lt;jenkins@build.gluster.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
inode_find (used to create the handle) takes a reference
of the inode. This needs to be un'refernced to avoid leak.

This is backport of below master patch -
   http://review.gluster.org/14984

&gt;Change-Id: I22f03577a8f1d9608cfc62d57202cfc4c2ba12b3
&gt;BUG: 1358608
&gt;Signed-off-by: Soumya Koduri &lt;skoduri@redhat.com&gt;
&gt;Reviewed-on: http://review.gluster.org/14984
&gt;Reviewed-by: jiffin tony Thottan &lt;jthottan@redhat.com&gt;
&gt;Reviewed-by: Jeff Darcy &lt;jdarcy@redhat.com&gt;
&gt;(cherry picked from commit bb48eb46910085928efbd7fb491c5b2db25bba98)

Change-Id: I92701af8a948d982fd4dbe31af32334c1bb26347
BUG: 1361665
Signed-off-by: Soumya Koduri &lt;skoduri@redhat.com&gt;
Reviewed-on: http://review.gluster.org/15049
NetBSD-regression: NetBSD Build System &lt;jenkins@build.gluster.org&gt;
CentOS-regression: Gluster Build System &lt;jenkins@build.gluster.org&gt;
Reviewed-by: Niels de Vos &lt;ndevos@redhat.com&gt;
Smoke: Gluster Build System &lt;jenkins@build.gluster.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>gfapi: update count when glfs_buf_copy is used</title>
<updated>2016-07-07T08:54:41+00:00</updated>
<author>
<name>Raghavendra Talur</name>
<email>rtalur@redhat.com</email>
</author>
<published>2016-07-04T13:06:26+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/commit/?id=01fed48b5b096bc22069003190377f45cca2176f'/>
<id>01fed48b5b096bc22069003190377f45cca2176f</id>
<content type='text'>
Backport of http://review.gluster.org/#/c/14854

glfs_buf_copy collates all iovecs into a iovec with count=1. If
gio-&gt;count is not updated it will lead to dereferencing of invalid
address.

Change-Id: I7c58071d5c6515ec6fee3ab36af206fa80cf37c3
BUG: 1352632
Signed-off-by: Raghavendra Talur &lt;rtalur@redhat.com&gt;
Signed-off-by: Poornima G &lt;pgurusid@redhat.com&gt;
Reported-By: Lindsay Mathieson &lt;lindsay.mathieson@gmail.com&gt;
Reported-By: Dmitry Melekhov &lt;dm@belkam.com&gt;
Reported-By: Tom Emerson &lt;TEmerson@cyberitas.com&gt;
Reviewed-on: http://review.gluster.org/14858
Smoke: Gluster Build System &lt;jenkins@build.gluster.org&gt;
Reviewed-by: Prashanth Pai &lt;ppai@redhat.com&gt;
CentOS-regression: Gluster Build System &lt;jenkins@build.gluster.org&gt;
NetBSD-regression: NetBSD Build System &lt;jenkins@build.gluster.org&gt;
Reviewed-by: Niels de Vos &lt;ndevos@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Backport of http://review.gluster.org/#/c/14854

glfs_buf_copy collates all iovecs into a iovec with count=1. If
gio-&gt;count is not updated it will lead to dereferencing of invalid
address.

Change-Id: I7c58071d5c6515ec6fee3ab36af206fa80cf37c3
BUG: 1352632
Signed-off-by: Raghavendra Talur &lt;rtalur@redhat.com&gt;
Signed-off-by: Poornima G &lt;pgurusid@redhat.com&gt;
Reported-By: Lindsay Mathieson &lt;lindsay.mathieson@gmail.com&gt;
Reported-By: Dmitry Melekhov &lt;dm@belkam.com&gt;
Reported-By: Tom Emerson &lt;TEmerson@cyberitas.com&gt;
Reviewed-on: http://review.gluster.org/14858
Smoke: Gluster Build System &lt;jenkins@build.gluster.org&gt;
Reviewed-by: Prashanth Pai &lt;ppai@redhat.com&gt;
CentOS-regression: Gluster Build System &lt;jenkins@build.gluster.org&gt;
NetBSD-regression: NetBSD Build System &lt;jenkins@build.gluster.org&gt;
Reviewed-by: Niels de Vos &lt;ndevos@redhat.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
