<feed xmlns='http://www.w3.org/2005/Atom'>
<title>glusterfs.git/api/src, branch v3.8.3</title>
<subtitle></subtitle>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/'/>
<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>
<entry>
<title>gfapi : check the value "iovec" in glfs_io_async_cbk only for read</title>
<updated>2016-07-04T13:24:06+00:00</updated>
<author>
<name>Jiffin Tony Thottan</name>
<email>jthottan@redhat.com</email>
</author>
<published>2016-06-23T06:50:03+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/commit/?id=4063e5763df30e3b5c7d553fcdfe1bab3830cee1'/>
<id>4063e5763df30e3b5c7d553fcdfe1bab3830cee1</id>
<content type='text'>
The glfs_io_async_cbk() is called from the cbk of all the async ops
such as write, read, fsync, ftruncate. In all other cases, expect for
read the value for "iovec" is NULL. From the code, glfs_io_async_cbk
checks the value in common routine which may end up in failures.

Thanks Joe Julian for finding issue and suggesting the fix.

Upstream reference
&gt;Change-Id: I0be0123da68f9d8fbb5d94ede2d45566a9add6a5
&gt;BUG: 1349276
&gt;Signed-off-by: Jiffin Tony Thottan &lt;jthottan@redhat.com&gt;
&gt;Reported-by: Joe Julian &lt;me@joejulian.name&gt;
&gt;Reviewed-on: http://review.gluster.org/14779
&gt;Reviewed-by: Niels de Vos &lt;ndevos@redhat.com&gt;
&gt;Smoke: Gluster Build System &lt;jenkins@build.gluster.org&gt;
&gt;Tested-by: Kaleb KEITHLEY &lt;kkeithle@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: Joe Julian &lt;me@joejulian.name&gt;
&gt;(cherry picked from commit 61d72b3d91f2655b04de4ef29262f738a8cf7369)

Change-Id: I0be0123da68f9d8fbb5d94ede2d45566a9add6a5
BUG: 1350789
Signed-off-by: Jiffin Tony Thottan &lt;jthottan@redhat.com&gt;
Reported-by: Joe Julian &lt;me@joejulian.name&gt;
Reviewed-on: http://review.gluster.org/14821
Smoke: Gluster Build System &lt;jenkins@build.gluster.org&gt;
NetBSD-regression: NetBSD Build System &lt;jenkins@build.gluster.org&gt;
Reviewed-by: Poornima G &lt;pgurusid@redhat.com&gt;
Reviewed-by: Kaleb KEITHLEY &lt;kkeithle@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>
The glfs_io_async_cbk() is called from the cbk of all the async ops
such as write, read, fsync, ftruncate. In all other cases, expect for
read the value for "iovec" is NULL. From the code, glfs_io_async_cbk
checks the value in common routine which may end up in failures.

Thanks Joe Julian for finding issue and suggesting the fix.

Upstream reference
&gt;Change-Id: I0be0123da68f9d8fbb5d94ede2d45566a9add6a5
&gt;BUG: 1349276
&gt;Signed-off-by: Jiffin Tony Thottan &lt;jthottan@redhat.com&gt;
&gt;Reported-by: Joe Julian &lt;me@joejulian.name&gt;
&gt;Reviewed-on: http://review.gluster.org/14779
&gt;Reviewed-by: Niels de Vos &lt;ndevos@redhat.com&gt;
&gt;Smoke: Gluster Build System &lt;jenkins@build.gluster.org&gt;
&gt;Tested-by: Kaleb KEITHLEY &lt;kkeithle@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: Joe Julian &lt;me@joejulian.name&gt;
&gt;(cherry picked from commit 61d72b3d91f2655b04de4ef29262f738a8cf7369)

Change-Id: I0be0123da68f9d8fbb5d94ede2d45566a9add6a5
BUG: 1350789
Signed-off-by: Jiffin Tony Thottan &lt;jthottan@redhat.com&gt;
Reported-by: Joe Julian &lt;me@joejulian.name&gt;
Reviewed-on: http://review.gluster.org/14821
Smoke: Gluster Build System &lt;jenkins@build.gluster.org&gt;
NetBSD-regression: NetBSD Build System &lt;jenkins@build.gluster.org&gt;
Reviewed-by: Poornima G &lt;pgurusid@redhat.com&gt;
Reviewed-by: Kaleb KEITHLEY &lt;kkeithle@redhat.com&gt;
CentOS-regression: Gluster Build System &lt;jenkins@build.gluster.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>gfapi/handleops: Avoid using glfd during create</title>
<updated>2016-07-01T09:36:46+00:00</updated>
<author>
<name>Soumya Koduri</name>
<email>skoduri@redhat.com</email>
</author>
<published>2016-05-25T09:08:31+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/commit/?id=01d1bee0321e1a0bf83f34130404440dc17a73d0'/>
<id>01d1bee0321e1a0bf83f34130404440dc17a73d0</id>
<content type='text'>
To avoid leaking glfd while creating a file using handleops and
since application shall not be interested in it, use the 'fd'
object directly which can be un'refed post create.

Upstream refernce :
&gt;Change-Id: I119874ffb63fb4aa18f846ba1fdbe77874b66a54
&gt;BUG: 1339553
&gt;Signed-off-by: Soumya Koduri &lt;skoduri@redhat.com&gt;
&gt;Signed-off-by: Jiffin Tony Thottan &lt;jthottan@redhat.com&gt;
&gt;Reviewed-on: http://review.gluster.org/14532
&gt;NetBSD-regression: NetBSD Build System &lt;jenkins@build.gluster.org&gt;
&gt;Reviewed-by: Niels de Vos &lt;ndevos@redhat.com&gt;
&gt;CentOS-regression: Gluster Build System &lt;jenkins@build.gluster.org&gt;
&gt;Tested-by: Gluster Build System &lt;jenkins@build.gluster.org&gt;
&gt;Smoke: Gluster Build System &lt;jenkins@build.gluster.org&gt;
&gt;(cherry picked from commit 763ed1017b0011934ad2414d7396c46e528ea5b3)

Change-Id: I119874ffb63fb4aa18f846ba1fdbe77874b66a54
BUG: 1350787
Signed-off-by: Soumya Koduri &lt;skoduri@redhat.com&gt;
Signed-off-by: Jiffin Tony Thottan &lt;jthottan@redhat.com&gt;
Reviewed-on: http://review.gluster.org/14820
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: Niels de Vos &lt;ndevos@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
To avoid leaking glfd while creating a file using handleops and
since application shall not be interested in it, use the 'fd'
object directly which can be un'refed post create.

Upstream refernce :
&gt;Change-Id: I119874ffb63fb4aa18f846ba1fdbe77874b66a54
&gt;BUG: 1339553
&gt;Signed-off-by: Soumya Koduri &lt;skoduri@redhat.com&gt;
&gt;Signed-off-by: Jiffin Tony Thottan &lt;jthottan@redhat.com&gt;
&gt;Reviewed-on: http://review.gluster.org/14532
&gt;NetBSD-regression: NetBSD Build System &lt;jenkins@build.gluster.org&gt;
&gt;Reviewed-by: Niels de Vos &lt;ndevos@redhat.com&gt;
&gt;CentOS-regression: Gluster Build System &lt;jenkins@build.gluster.org&gt;
&gt;Tested-by: Gluster Build System &lt;jenkins@build.gluster.org&gt;
&gt;Smoke: Gluster Build System &lt;jenkins@build.gluster.org&gt;
&gt;(cherry picked from commit 763ed1017b0011934ad2414d7396c46e528ea5b3)

Change-Id: I119874ffb63fb4aa18f846ba1fdbe77874b66a54
BUG: 1350787
Signed-off-by: Soumya Koduri &lt;skoduri@redhat.com&gt;
Signed-off-by: Jiffin Tony Thottan &lt;jthottan@redhat.com&gt;
Reviewed-on: http://review.gluster.org/14820
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: Niels de Vos &lt;ndevos@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>gfapi/upcall: Ignore handle create failures</title>
<updated>2016-06-17T12:25:29+00:00</updated>
<author>
<name>Soumya Koduri</name>
<email>skoduri@redhat.com</email>
</author>
<published>2016-04-30T16:31:47+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/commit/?id=ae47d5b55e5c5f32a45bd9d1dd741a1c072ab2d6'/>
<id>ae47d5b55e5c5f32a45bd9d1dd741a1c072ab2d6</id>
<content type='text'>
In "glfs_h_poll_cache_invalidation", we need to send upcall only if there
is a corresponding inode entry in the gfapi inode table for that handle.

That's because the application will have reference to the inode as long as
it operates on any handle. That means the only case in which we cannot find
inode is when the application has closed the handle (either as part of unlink
or for any other purpose). But since it will have no more references and will
not be interested in any upcall event for that handle, we can safely ignore such
cases.

Note: This will affect only that particular applicaiton process/local libgfapi
client.

This is backport of below mainline patch -
   http://review.gluster.org/14132

Change-Id: I9499cd9c284350d4a271e58f2a0966db65a7a61c
BUG: 1347590
Signed-off-by: Soumya Koduri &lt;skoduri@redhat.com&gt;
Reviewed-on: http://review.gluster.org/14132
Reviewed-by: jiffin tony Thottan &lt;jthottan@redhat.com&gt;
Reviewed-by: Kaleb KEITHLEY &lt;kkeithle@redhat.com&gt;
(cherry picked from commit fb77938fc7810dc5ac16b0de9694157cde93635e)
Reviewed-on: http://review.gluster.org/14756
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;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In "glfs_h_poll_cache_invalidation", we need to send upcall only if there
is a corresponding inode entry in the gfapi inode table for that handle.

That's because the application will have reference to the inode as long as
it operates on any handle. That means the only case in which we cannot find
inode is when the application has closed the handle (either as part of unlink
or for any other purpose). But since it will have no more references and will
not be interested in any upcall event for that handle, we can safely ignore such
cases.

Note: This will affect only that particular applicaiton process/local libgfapi
client.

This is backport of below mainline patch -
   http://review.gluster.org/14132

Change-Id: I9499cd9c284350d4a271e58f2a0966db65a7a61c
BUG: 1347590
Signed-off-by: Soumya Koduri &lt;skoduri@redhat.com&gt;
Reviewed-on: http://review.gluster.org/14132
Reviewed-by: jiffin tony Thottan &lt;jthottan@redhat.com&gt;
Reviewed-by: Kaleb KEITHLEY &lt;kkeithle@redhat.com&gt;
(cherry picked from commit fb77938fc7810dc5ac16b0de9694157cde93635e)
Reviewed-on: http://review.gluster.org/14756
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;
</pre>
</div>
</content>
</entry>
<entry>
<title>gfapi: Fix IO error caused when there is consecutive graph switches</title>
<updated>2016-06-17T11:35:25+00:00</updated>
<author>
<name>Poornima G</name>
<email>pgurusid@redhat.com</email>
</author>
<published>2016-06-06T10:29:40+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/commit/?id=cf1e98ff5bf8233803b4f74debee1b1f474765af'/>
<id>cf1e98ff5bf8233803b4f74debee1b1f474765af</id>
<content type='text'>
Backport of http://review.gluster.org/#/c/14656/

Issue:
Consider a simple situation, where glfs_init() is done, i.e. initial
graph is up. Now perform 2 volume sets that results in 2 client side
graph changes. After this perform some IO, the IO fails with ENOTCON.
The only way to recover this client is i guess another graph switch
or restart.

What actually is happening from code perspective:
Initial graph lets say A, followed by 2 consecutive graph switches
to B and C without any IO those two switches.

- graph_setup (A) as a result of GF_EVENT_CHILD_UP, and
fs-&gt;next_subvol = A

- glfs_init() results in fs-&gt;active_subvol = A, fs-&gt;next_subvol = NULL

- graph_setup (B) as a result of GF_EVENT_CHILD_UP, and
fs-&gt;next_subvol = B

- graph_setup (C) as a result of GF_EVENT_CHILD_UP, and
fs-&gt;next_subvol = C. It also sees that the previous graph B was never
set as fs-&gt;active_subvol, i.e. no IO or anything happened on B, so
can safely send GF_EVENT_PARENT_DOWN (by calling glfs_subvol_done(B)).
This parent down on B, results in child_down(B), which is fine.
But child_down also triggers graph_setup(B).

- graph_setup(B) as a result of GF_EVENT_CHILD_DOWN, and
fs-&gt;next_subvol = B, and GF_EVENT_PARENT_DOWN on C as explained
above. This again leads to GF_EVENT_CHILD_DOWN on C.

- graph_setup(C) as a result of GF_EVENT_CHILD_DOWN, and
fs-&gt;next_subvol = C, and GF_EVENT_PARENT_DOWN on B as explained
above.

Thus both the graphs B and C are disconnected, and hence the ENOTCON

Solution:
Remove the call to graph_setup() when the event is GF_EVENT_CHILD_DOWN.
It don't see any reason why graph_setup should be called when there is
child_down. Not sure what the original reason was, to have graph_setup
in child_down. git hostory shows the first patch itself had this call.

Change-Id: I9de86555f66cc94a05649ac863b40ed3426ffd4b
BUG: 1347489
Signed-off-by: Poornima G &lt;pgurusid@redhat.com&gt;
Reviewed-on: http://review.gluster.org/14656
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: Jeff Darcy &lt;jdarcy@redhat.com&gt;
(cherry picked from commit b8ac20e888fbacad9d90cd8f1c6ff8579a5cefe9)
Reviewed-on: http://review.gluster.org/14747
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Backport of http://review.gluster.org/#/c/14656/

Issue:
Consider a simple situation, where glfs_init() is done, i.e. initial
graph is up. Now perform 2 volume sets that results in 2 client side
graph changes. After this perform some IO, the IO fails with ENOTCON.
The only way to recover this client is i guess another graph switch
or restart.

What actually is happening from code perspective:
Initial graph lets say A, followed by 2 consecutive graph switches
to B and C without any IO those two switches.

- graph_setup (A) as a result of GF_EVENT_CHILD_UP, and
fs-&gt;next_subvol = A

- glfs_init() results in fs-&gt;active_subvol = A, fs-&gt;next_subvol = NULL

- graph_setup (B) as a result of GF_EVENT_CHILD_UP, and
fs-&gt;next_subvol = B

- graph_setup (C) as a result of GF_EVENT_CHILD_UP, and
fs-&gt;next_subvol = C. It also sees that the previous graph B was never
set as fs-&gt;active_subvol, i.e. no IO or anything happened on B, so
can safely send GF_EVENT_PARENT_DOWN (by calling glfs_subvol_done(B)).
This parent down on B, results in child_down(B), which is fine.
But child_down also triggers graph_setup(B).

- graph_setup(B) as a result of GF_EVENT_CHILD_DOWN, and
fs-&gt;next_subvol = B, and GF_EVENT_PARENT_DOWN on C as explained
above. This again leads to GF_EVENT_CHILD_DOWN on C.

- graph_setup(C) as a result of GF_EVENT_CHILD_DOWN, and
fs-&gt;next_subvol = C, and GF_EVENT_PARENT_DOWN on B as explained
above.

Thus both the graphs B and C are disconnected, and hence the ENOTCON

Solution:
Remove the call to graph_setup() when the event is GF_EVENT_CHILD_DOWN.
It don't see any reason why graph_setup should be called when there is
child_down. Not sure what the original reason was, to have graph_setup
in child_down. git hostory shows the first patch itself had this call.

Change-Id: I9de86555f66cc94a05649ac863b40ed3426ffd4b
BUG: 1347489
Signed-off-by: Poornima G &lt;pgurusid@redhat.com&gt;
Reviewed-on: http://review.gluster.org/14656
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: Jeff Darcy &lt;jdarcy@redhat.com&gt;
(cherry picked from commit b8ac20e888fbacad9d90cd8f1c6ff8579a5cefe9)
Reviewed-on: http://review.gluster.org/14747
</pre>
</div>
</content>
</entry>
</feed>
