<feed xmlns='http://www.w3.org/2005/Atom'>
<title>glusterfs.git/xlators/mgmt/glusterd/src/glusterd-store.c, branch v5.12</title>
<subtitle></subtitle>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/'/>
<entry>
<title>glusterd: acquire lock to update volinfo structure</title>
<updated>2018-09-27T15:36:12+00:00</updated>
<author>
<name>Sanju Rakonde</name>
<email>srakonde@redhat.com</email>
</author>
<published>2018-09-11T08:49:42+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/commit/?id=a39d7273eb8efecf88613a7ba284a9a3cd970be9'/>
<id>a39d7273eb8efecf88613a7ba284a9a3cd970be9</id>
<content type='text'>
Problem: With commit cb0339f92, we are using a separate syntask
for restart_bricks. There can be a situation where two threads
are accessing the same volinfo structure at the same time and
updating volinfo structure. This can lead volinfo to have
inconsistent values and assertion failures because of unexpected
values.

Solution: While updating the volinfo structure, acquire a
store_volinfo_lock, and release the lock only when the thread
completed its critical section part.

&gt; BUG: bz#1627610
&gt; Signed-off-by: Sanju Rakonde &lt;srakonde@redhat.com&gt;

&gt; Change-Id: I545e4e2368e3285d8f7aa28081ff4448abb72f5d
(cherry picked from commit 484f417da945cf83afdbf136bb4817311862a8d2)

fixes: bz#1633552

Change-Id: I545e4e2368e3285d8f7aa28081ff4448abb72f5d
Signed-off-by: Sanju Rakonde &lt;srakonde@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem: With commit cb0339f92, we are using a separate syntask
for restart_bricks. There can be a situation where two threads
are accessing the same volinfo structure at the same time and
updating volinfo structure. This can lead volinfo to have
inconsistent values and assertion failures because of unexpected
values.

Solution: While updating the volinfo structure, acquire a
store_volinfo_lock, and release the lock only when the thread
completed its critical section part.

&gt; BUG: bz#1627610
&gt; Signed-off-by: Sanju Rakonde &lt;srakonde@redhat.com&gt;

&gt; Change-Id: I545e4e2368e3285d8f7aa28081ff4448abb72f5d
(cherry picked from commit 484f417da945cf83afdbf136bb4817311862a8d2)

fixes: bz#1633552

Change-Id: I545e4e2368e3285d8f7aa28081ff4448abb72f5d
Signed-off-by: Sanju Rakonde &lt;srakonde@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>glusterd: make sure that brickinfo-&gt;uuid is not null</title>
<updated>2018-09-27T06:18:39+00:00</updated>
<author>
<name>Sanju Rakonde</name>
<email>srakonde@redhat.com</email>
</author>
<published>2018-09-25T18:06:48+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/commit/?id=7ab0f691f0bd08585d06a26f23dc24f62ddd6251'/>
<id>7ab0f691f0bd08585d06a26f23dc24f62ddd6251</id>
<content type='text'>
Problem: After an upgrade from the version where shared-brick-count
option is not present to a version which introduced this option
causes issue at the mount point i.e, size of the volume at mount
point will be reduced by shared-brick-count value times.

Cause: shared-brick-count is equal to the number of bricks that
are sharing the file system. gd_set_shared_brick_count() calculates
the shared-brick-count value based on uuid of the node and fsid of
the brick. https://review.gluster.org/#/c/glusterfs/+/19484 handles
setting of fsid properly during an upgrade path. This patch assumed
that when the code path is reached, brickinfo-&gt;uuid is non-null.
But brickinfo-&gt;uuid is null for all the bricks, as the uuid is null
https://review.gluster.org/#/c/glusterfs/+/19484 couldn't reached the
code path to set the fsid for bricks. So, we had fsid as 0 for all
bricks, which resulted in gd_set_shared_brick_count() to calculate
shared-brick-count in a wrong way. i.e, the logic written in
gd_set_shared_brick_count() didn't work as expected since fsid is 0.

Solution: Before control reaches the code path written by
https://review.gluster.org/#/c/glusterfs/+/19484,
adding a check for whether brickinfo-&gt;uuid is null and
if brickinfo-&gt;uuid is having null value, calling
glusterd_resolve_brick will set the brickinfo-&gt;uuid to a 
proper value. When we have proper uuid, fsid for the bricks
will be set properly and shared-brick-count value will be
caluculated correctly.

Please take a look at the bug https://bugzilla.redhat.com/show_bug.cgi?id=1632889
for complete RCA

Steps followed to test the fix:
1. Created a 2 node cluster, the cluster is running with binary
which doesn't have shared-brick-count option
2. Created a 2x(2+1) volume and started it
3. Mouted the volume, checked size of volume using df
4. Upgrade to a version where shared-brick-count is introduced
(upgraded the nodes one by one i.e, stop the glusterd, upgrade the node
and start the glusterd).
5. after upgrading both the nodes, bumped up the cluster.op-version
6. At mount point, df shows the correct size for volume.

&gt; backport of https://review.gluster.org/#/c/glusterfs/+/21278/
&gt; Change-Id: Ib9f078aafb15e899a01086eae113270657ea916b
&gt; Signed-off-by: Sanju Rakonde &lt;srakonde@redhat.com&gt;
(cherry picked from commit f1e9b878ce2067db83a0baa5f384eda87287719d)

fixes: bz#1633242
Change-Id: Ib9f078aafb15e899a01086eae113270657ea916b
Signed-off-by: Sanju Rakonde &lt;srakonde@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem: After an upgrade from the version where shared-brick-count
option is not present to a version which introduced this option
causes issue at the mount point i.e, size of the volume at mount
point will be reduced by shared-brick-count value times.

Cause: shared-brick-count is equal to the number of bricks that
are sharing the file system. gd_set_shared_brick_count() calculates
the shared-brick-count value based on uuid of the node and fsid of
the brick. https://review.gluster.org/#/c/glusterfs/+/19484 handles
setting of fsid properly during an upgrade path. This patch assumed
that when the code path is reached, brickinfo-&gt;uuid is non-null.
But brickinfo-&gt;uuid is null for all the bricks, as the uuid is null
https://review.gluster.org/#/c/glusterfs/+/19484 couldn't reached the
code path to set the fsid for bricks. So, we had fsid as 0 for all
bricks, which resulted in gd_set_shared_brick_count() to calculate
shared-brick-count in a wrong way. i.e, the logic written in
gd_set_shared_brick_count() didn't work as expected since fsid is 0.

Solution: Before control reaches the code path written by
https://review.gluster.org/#/c/glusterfs/+/19484,
adding a check for whether brickinfo-&gt;uuid is null and
if brickinfo-&gt;uuid is having null value, calling
glusterd_resolve_brick will set the brickinfo-&gt;uuid to a 
proper value. When we have proper uuid, fsid for the bricks
will be set properly and shared-brick-count value will be
caluculated correctly.

Please take a look at the bug https://bugzilla.redhat.com/show_bug.cgi?id=1632889
for complete RCA

Steps followed to test the fix:
1. Created a 2 node cluster, the cluster is running with binary
which doesn't have shared-brick-count option
2. Created a 2x(2+1) volume and started it
3. Mouted the volume, checked size of volume using df
4. Upgrade to a version where shared-brick-count is introduced
(upgraded the nodes one by one i.e, stop the glusterd, upgrade the node
and start the glusterd).
5. after upgrading both the nodes, bumped up the cluster.op-version
6. At mount point, df shows the correct size for volume.

&gt; backport of https://review.gluster.org/#/c/glusterfs/+/21278/
&gt; Change-Id: Ib9f078aafb15e899a01086eae113270657ea916b
&gt; Signed-off-by: Sanju Rakonde &lt;srakonde@redhat.com&gt;
(cherry picked from commit f1e9b878ce2067db83a0baa5f384eda87287719d)

fixes: bz#1633242
Change-Id: Ib9f078aafb15e899a01086eae113270657ea916b
Signed-off-by: Sanju Rakonde &lt;srakonde@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Land part 2 of clang-format changes</title>
<updated>2018-09-12T12:22:45+00:00</updated>
<author>
<name>Gluster Ant</name>
<email>bugzilla-bot@gluster.org</email>
</author>
<published>2018-09-12T12:22:45+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/commit/?id=e16868dede6455cab644805af6fe1ac312775e13'/>
<id>e16868dede6455cab644805af6fe1ac312775e13</id>
<content type='text'>
Change-Id: Ia84cc24c8924e6d22d02ac15f611c10e26db99b4
Signed-off-by: Nigel Babu &lt;nigelb@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change-Id: Ia84cc24c8924e6d22d02ac15f611c10e26db99b4
Signed-off-by: Nigel Babu &lt;nigelb@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>multiple xlators (mgmt): strncpy()-&gt;sprintf(), reduce strlen()'s</title>
<updated>2018-09-07T16:17:18+00:00</updated>
<author>
<name>Yaniv Kaul</name>
<email>ykaul@redhat.com</email>
</author>
<published>2018-08-21T17:41:20+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/commit/?id=a880d6f6aa7a2979df8aa32b58f716ef0c578d3f'/>
<id>a880d6f6aa7a2979df8aa32b58f716ef0c578d3f</id>
<content type='text'>
xlators/mgmt/glusterd/src/glusterd-geo-rep.c
xlators/mgmt/glusterd/src/glusterd-handshake.c
xlators/mgmt/glusterd/src/glusterd-sm.c
xlators/mgmt/glusterd/src/glusterd-store.c
xlators/mgmt/glusterd/src/glusterd-utils.c
xlators/mgmt/glusterd/src/glusterd-volgen.c
xlators/mgmt/glusterd/src/glusterd-volume-ops.c
xlators/mgmt/glusterd/src/glusterd.c

strncpy may not be very efficient for short strings copied into
a large buffer: If the length of src is less than n,
strncpy() writes additional null bytes to dest to ensure
that a total of n bytes are written.

Instead, use snprintf(). Try to ensure output is not
truncated.

Also:
- save the result of strlen() and re-use it when possible.
- move from strlen to SLEN (sizeof() ) for const strings.

Compile-tested only!

Change-Id: Ib5d001857236f43e41c4a51b5f48e1a33110aaeb
updates: bz#1193929
Signed-off-by: Yaniv Kaul &lt;ykaul@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
xlators/mgmt/glusterd/src/glusterd-geo-rep.c
xlators/mgmt/glusterd/src/glusterd-handshake.c
xlators/mgmt/glusterd/src/glusterd-sm.c
xlators/mgmt/glusterd/src/glusterd-store.c
xlators/mgmt/glusterd/src/glusterd-utils.c
xlators/mgmt/glusterd/src/glusterd-volgen.c
xlators/mgmt/glusterd/src/glusterd-volume-ops.c
xlators/mgmt/glusterd/src/glusterd.c

strncpy may not be very efficient for short strings copied into
a large buffer: If the length of src is less than n,
strncpy() writes additional null bytes to dest to ensure
that a total of n bytes are written.

Instead, use snprintf(). Try to ensure output is not
truncated.

Also:
- save the result of strlen() and re-use it when possible.
- move from strlen to SLEN (sizeof() ) for const strings.

Compile-tested only!

Change-Id: Ib5d001857236f43e41c4a51b5f48e1a33110aaeb
updates: bz#1193929
Signed-off-by: Yaniv Kaul &lt;ykaul@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>glusterd : fix some coverity issues in glusterd-store.c</title>
<updated>2018-09-05T02:20:29+00:00</updated>
<author>
<name>Sunny Kumar</name>
<email>sunkumar@redhat.com</email>
</author>
<published>2018-09-04T08:43:18+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/commit/?id=4d198e33ba2ff5b550e8095af3c8d0b76c18bc2f'/>
<id>4d198e33ba2ff5b550e8095af3c8d0b76c18bc2f</id>
<content type='text'>
This patch fixes CID 1382346, 1274190 and 1382403.

Change-Id: I1968e686587719e74bd70fa1542c20bccc04a7f9
updates: bz#789278
Signed-off-by: Sunny Kumar &lt;sunkumar@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch fixes CID 1382346, 1274190 and 1382403.

Change-Id: I1968e686587719e74bd70fa1542c20bccc04a7f9
updates: bz#789278
Signed-off-by: Sunny Kumar &lt;sunkumar@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>glusterd: fix some coverity issues</title>
<updated>2018-08-20T12:10:45+00:00</updated>
<author>
<name>Bhumika Goyal</name>
<email>bgoyal@redhat.com</email>
</author>
<published>2018-08-17T18:36:58+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/commit/?id=788cda4cd36574092bef1449ecda579163d06776'/>
<id>788cda4cd36574092bef1449ecda579163d06776</id>
<content type='text'>
Fixes CID: 1241481 1241482 1274079 1274118 1274121  1274131 1274198
1274214 1274220 1274224 1394663 1394641 382454 1382453 1382449 1288095

Link: https://scan6.coverity.com/reports.htm#v42388/p10714/fileInstanceId=84772667&amp;defectInstanceId=25770661&amp;mergedDefectId=744716

Change-Id: Idaf434186231c8b0fff4b27c57fa23636a89c8a7
updates: bz#789278
Signed-off-by: Bhumika Goyal &lt;bgoyal@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes CID: 1241481 1241482 1274079 1274118 1274121  1274131 1274198
1274214 1274220 1274224 1394663 1394641 382454 1382453 1382449 1288095

Link: https://scan6.coverity.com/reports.htm#v42388/p10714/fileInstanceId=84772667&amp;defectInstanceId=25770661&amp;mergedDefectId=744716

Change-Id: Idaf434186231c8b0fff4b27c57fa23636a89c8a7
updates: bz#789278
Signed-off-by: Bhumika Goyal &lt;bgoyal@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>glusterd: coverity defects fix introduced by commit 1f3bfe7</title>
<updated>2018-08-17T02:50:14+00:00</updated>
<author>
<name>Atin Mukherjee</name>
<email>amukherj@redhat.com</email>
</author>
<published>2018-08-16T04:33:22+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/commit/?id=fa16371475a115213390cd84d38cec75032f24d4'/>
<id>fa16371475a115213390cd84d38cec75032f24d4</id>
<content type='text'>
Commit 1f3bfe7 stripped down the total size of certain path related variables
in glusterd_brickinfo_t which considered couple of new coverity defects.

Fix the following:
CID : 1394969 Destination buffer too small
CID : 1394968 Out-of-bounds access

Change-Id: Ibc30eac4680cc6c83bd89d248f1435cb6a3d1b75
updates: bz#789278
Signed-off-by: Atin Mukherjee &lt;amukherj@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Commit 1f3bfe7 stripped down the total size of certain path related variables
in glusterd_brickinfo_t which considered couple of new coverity defects.

Fix the following:
CID : 1394969 Destination buffer too small
CID : 1394968 Out-of-bounds access

Change-Id: Ibc30eac4680cc6c83bd89d248f1435cb6a3d1b75
updates: bz#789278
Signed-off-by: Atin Mukherjee &lt;amukherj@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>All: remove memset() before sprintf()</title>
<updated>2018-08-14T05:15:04+00:00</updated>
<author>
<name>Yaniv Kaul</name>
<email>ykaul@redhat.com</email>
</author>
<published>2018-08-02T13:02:33+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/commit/?id=b2b6ab8eff317f6a507ab23897ea6cd5c718d99a'/>
<id>b2b6ab8eff317f6a507ab23897ea6cd5c718d99a</id>
<content type='text'>
It's not needed.
There's a good chance the compiler is smart enough to remove it
anyway, but it can't hurt - I hope.

Compile-tested only!

Change-Id: Id7c054e146ba630227affa591007803f3046416b
updates: bz#1193929
Signed-off-by: Yaniv Kaul &lt;ykaul@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It's not needed.
There's a good chance the compiler is smart enough to remove it
anyway, but it can't hurt - I hope.

Compile-tested only!

Change-Id: Id7c054e146ba630227affa591007803f3046416b
updates: bz#1193929
Signed-off-by: Yaniv Kaul &lt;ykaul@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>glusterd: Coverity issues with type FORWARD_NULL</title>
<updated>2018-07-24T23:55:12+00:00</updated>
<author>
<name>Sanju Rakonde</name>
<email>srakonde@redhat.com</email>
</author>
<published>2018-07-24T08:57:02+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/commit/?id=8ad159b2a7e302320a24d1d4f5d0b90302e0f25b'/>
<id>8ad159b2a7e302320a24d1d4f5d0b90302e0f25b</id>
<content type='text'>
This patch fixes coverity issues 102, 103, 112 and 119 from [1]

[1] https://download.gluster.org/pub/gluster/glusterfs/static-analysis/master/glusterfs-coverity/2018-07-23-5fa004f3/html/

Updates: bz#789278

Change-Id: I99762eb0bcbd974a5250434777db63520f2ce2e6
Signed-off-by: Sanju Rakonde &lt;srakonde@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch fixes coverity issues 102, 103, 112 and 119 from [1]

[1] https://download.gluster.org/pub/gluster/glusterfs/static-analysis/master/glusterfs-coverity/2018-07-23-5fa004f3/html/

Updates: bz#789278

Change-Id: I99762eb0bcbd974a5250434777db63520f2ce2e6
Signed-off-by: Sanju Rakonde &lt;srakonde@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>glusterd-store: fix coverity warning</title>
<updated>2018-07-17T05:41:46+00:00</updated>
<author>
<name>Yaniv Kaul</name>
<email>ykaul@redhat.com</email>
</author>
<published>2018-07-16T08:25:41+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/commit/?id=c02a25515aba085c7dfa2033f830760e7458301d'/>
<id>c02a25515aba085c7dfa2033f830760e7458301d</id>
<content type='text'>
The same variable 'len' was used both in the macros and the functions.
(Introduced as part of commit 6dc5dfef819cad69d6d4b4c1c305efa74236ad84 ?)

Change-Id: If434999d6470067f8a1e501c8e132561e8cd81ef
updates: bz#1193929
Signed-off-by: Yaniv Kaul &lt;ykaul@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The same variable 'len' was used both in the macros and the functions.
(Introduced as part of commit 6dc5dfef819cad69d6d4b4c1c305efa74236ad84 ?)

Change-Id: If434999d6470067f8a1e501c8e132561e8cd81ef
updates: bz#1193929
Signed-off-by: Yaniv Kaul &lt;ykaul@redhat.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
