<feed xmlns='http://www.w3.org/2005/Atom'>
<title>glusterfs.git/xlators/mgmt/glusterd/src/glusterd-volgen.c, branch v5.0rc1</title>
<subtitle></subtitle>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/'/>
<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>mgmt xlators: store boolean fields using integer</title>
<updated>2018-09-11T07:10:48+00:00</updated>
<author>
<name>Yaniv Kaul</name>
<email>ykaul@redhat.com</email>
</author>
<published>2018-09-10T14:04:30+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/commit/?id=8ac8f359b24c8583eb1a15b9926929770b869db8'/>
<id>8ac8f359b24c8583eb1a15b9926929770b869db8</id>
<content type='text'>
Surprisingly, there is not set_boolean() as there is a get_boolean()
In fact, it is stored as an INT dictionary type.

In some occasions it was stored using a string, and this caused
errors such as:
key gfproxy-server, integer type asked, has string type [Invalid argument]

I've fixed what I saw in some logs, I'm sure there are more.
The CORRECT fix is to create a boolean set and use it, but this
requires a bit more work. I'll see if I can do it later on.

Only compile-tested!

updates: bz#1193929
Signed-off-by: Yaniv Kaul &lt;ykaul@redhat.com&gt;

Change-Id: I45fd0c7a0824b2f42b8ce510296c9dfa4f32ad66
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Surprisingly, there is not set_boolean() as there is a get_boolean()
In fact, it is stored as an INT dictionary type.

In some occasions it was stored using a string, and this caused
errors such as:
key gfproxy-server, integer type asked, has string type [Invalid argument]

I've fixed what I saw in some logs, I'm sure there are more.
The CORRECT fix is to create a boolean set and use it, but this
requires a bit more work. I'll see if I can do it later on.

Only compile-tested!

updates: bz#1193929
Signed-off-by: Yaniv Kaul &lt;ykaul@redhat.com&gt;

Change-Id: I45fd0c7a0824b2f42b8ce510296c9dfa4f32ad66
</pre>
</div>
</content>
</entry>
<entry>
<title>mgmt/glusterd : Fix coverity issue</title>
<updated>2018-09-11T02:32:47+00:00</updated>
<author>
<name>Ashish Pandey</name>
<email>aspandey@redhat.com</email>
</author>
<published>2018-09-10T11:05:25+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/commit/?id=23fa1feaf0a3ab482628ab5b7b950d27e57fb46d'/>
<id>23fa1feaf0a3ab482628ab5b7b950d27e57fb46d</id>
<content type='text'>
CID: 727146, 727066

https://scan6.coverity.com/reports.htm#v42607/p10714/fileInstanceId=85393035&amp;defectInstanceId=26034751&amp;mergedDefectId=727146
https://scan6.coverity.com/reports.htm#v42607/p10714/fileInstanceId=85392913&amp;defectInstanceId=26034571&amp;mergedDefectId=727066

updates: bz#789278

Change-Id: Ieaef33829ec88e68690dabce4ea21d2e61dad9f6
Signed-off-by: Ashish Pandey &lt;aspandey@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
CID: 727146, 727066

https://scan6.coverity.com/reports.htm#v42607/p10714/fileInstanceId=85393035&amp;defectInstanceId=26034751&amp;mergedDefectId=727146
https://scan6.coverity.com/reports.htm#v42607/p10714/fileInstanceId=85392913&amp;defectInstanceId=26034571&amp;mergedDefectId=727066

updates: bz#789278

Change-Id: Ieaef33829ec88e68690dabce4ea21d2e61dad9f6
Signed-off-by: Ashish Pandey &lt;aspandey@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>multiple files: remove unndeeded memset()</title>
<updated>2018-08-29T17:31:11+00:00</updated>
<author>
<name>Yaniv Kaul</name>
<email>ykaul@redhat.com</email>
</author>
<published>2018-08-24T17:59:30+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/commit/?id=cbe133c832fd9907619a1231aa3d9dda1330ae74'/>
<id>cbe133c832fd9907619a1231aa3d9dda1330ae74</id>
<content type='text'>
This is a squash of multiple commits:

contrib/fuse-lib/misc.c: remove unneeded memset()

All flock variables are properly set, no need to memset it.

Only compile-tested!

Signed-off-by: Yaniv Kaul &lt;ykaul@redhat.com&gt;

Change-Id: I8e0512c5a88daadb0e587f545fdb9b32ca8858a2

libglusterfs/src/{client_t|fd|inode|stack}.c: remove some memset()

I don't think there's a need for any of them.

Only compile-tested!

Signed-off-by: Yaniv Kaul &lt;ykaul@redhat.com&gt;

Change-Id: I2be9ccc3a5cb5da51a92af73488cdabd1c527f59

libglusterfs/src/xlator.c: remove unneeded memset()

All xl-&gt;mem_acct members are properly set,
no need to memset it.

Only compile-tested!

Signed-off-by: Yaniv Kaul &lt;ykaul@redhat.com&gt;

Change-Id: I7f264cd47e7a06255a3f3943c583de77ae8e3147

xlators/cluster/afr/src/afr-self-heal-common.c: remove unneeded memset()

Since we are going over the whole array anyway, initialize it
properly, to either 1 or 0.

Only compile-tested!

Signed-off-by: Yaniv Kaul &lt;ykaul@redhat.com&gt;

Change-Id: Ied4210388976b6a7a2e91cc3de334534d6fef201

xlators/cluster/dht/src/dht-common.c: remove unneeded memset()

Since we are going over the whole array anyway it is initialized
properly.

Only compile-tested!

Signed-off-by: Yaniv Kaul &lt;ykaul@redhat.com&gt;

Change-Id: Idc436d2bd0563b6582908d7cbebf9dbc66a42c9a

xlators/cluster/ec/src/ec-helpers.c: remove unneeded memset()

Since we are going over the whole array anyway it is initialized
properly.

Only compile-tested!

Signed-off-by: Yaniv Kaul &lt;ykaul@redhat.com&gt;

Change-Id: I81bf971f7fcecb4599e807d37f426f55711978fa

xlators/mgmt/glusterd/src/glusterd-volgen.c: remove some memset()

I don't think there's a need for any of them.

Only compile-tested!

Signed-off-by: Yaniv Kaul &lt;ykaul@redhat.com&gt;

Change-Id: I476ea59ba53546b5153c269692cd5383da81ce2d

xlators/mgmt/glusterd/src/glusterd-geo-rep.c: read() in 4K blocks

The current 1K seems small. 4K is usually better (in Linux).

Also remove a memset() that I don't think is needed between reads.

Only compile-tested!

Signed-off-by: Yaniv Kaul &lt;ykaul@redhat.com&gt;

Change-Id: I5fb7950c92d282948376db14919ad12e589eac2b

xlators/storage/posix/src/posix-{gfid-path|inode-fd-ops}.c: remove memset()
before sys_*xattr() functions.

I don't see a reason to memset the array sent to the functions
sys_llistxattr(), sys_lgetxattr(), sys_lgetxattr(), sys_flistxattr(),
sys_fgetxattr().

(Note: it's unclear to me why we are calling sys_*txattr() functions with
XATTR_VAL_BUF_SIZE-1 size instead of XATTR_VAL_BUF_SIZE ).

Only compile-tested!

Change-Id: Ief2103b56ba6c71e40ed343a93684eef6b771346
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>
This is a squash of multiple commits:

contrib/fuse-lib/misc.c: remove unneeded memset()

All flock variables are properly set, no need to memset it.

Only compile-tested!

Signed-off-by: Yaniv Kaul &lt;ykaul@redhat.com&gt;

Change-Id: I8e0512c5a88daadb0e587f545fdb9b32ca8858a2

libglusterfs/src/{client_t|fd|inode|stack}.c: remove some memset()

I don't think there's a need for any of them.

Only compile-tested!

Signed-off-by: Yaniv Kaul &lt;ykaul@redhat.com&gt;

Change-Id: I2be9ccc3a5cb5da51a92af73488cdabd1c527f59

libglusterfs/src/xlator.c: remove unneeded memset()

All xl-&gt;mem_acct members are properly set,
no need to memset it.

Only compile-tested!

Signed-off-by: Yaniv Kaul &lt;ykaul@redhat.com&gt;

Change-Id: I7f264cd47e7a06255a3f3943c583de77ae8e3147

xlators/cluster/afr/src/afr-self-heal-common.c: remove unneeded memset()

Since we are going over the whole array anyway, initialize it
properly, to either 1 or 0.

Only compile-tested!

Signed-off-by: Yaniv Kaul &lt;ykaul@redhat.com&gt;

Change-Id: Ied4210388976b6a7a2e91cc3de334534d6fef201

xlators/cluster/dht/src/dht-common.c: remove unneeded memset()

Since we are going over the whole array anyway it is initialized
properly.

Only compile-tested!

Signed-off-by: Yaniv Kaul &lt;ykaul@redhat.com&gt;

Change-Id: Idc436d2bd0563b6582908d7cbebf9dbc66a42c9a

xlators/cluster/ec/src/ec-helpers.c: remove unneeded memset()

Since we are going over the whole array anyway it is initialized
properly.

Only compile-tested!

Signed-off-by: Yaniv Kaul &lt;ykaul@redhat.com&gt;

Change-Id: I81bf971f7fcecb4599e807d37f426f55711978fa

xlators/mgmt/glusterd/src/glusterd-volgen.c: remove some memset()

I don't think there's a need for any of them.

Only compile-tested!

Signed-off-by: Yaniv Kaul &lt;ykaul@redhat.com&gt;

Change-Id: I476ea59ba53546b5153c269692cd5383da81ce2d

xlators/mgmt/glusterd/src/glusterd-geo-rep.c: read() in 4K blocks

The current 1K seems small. 4K is usually better (in Linux).

Also remove a memset() that I don't think is needed between reads.

Only compile-tested!

Signed-off-by: Yaniv Kaul &lt;ykaul@redhat.com&gt;

Change-Id: I5fb7950c92d282948376db14919ad12e589eac2b

xlators/storage/posix/src/posix-{gfid-path|inode-fd-ops}.c: remove memset()
before sys_*xattr() functions.

I don't see a reason to memset the array sent to the functions
sys_llistxattr(), sys_lgetxattr(), sys_lgetxattr(), sys_flistxattr(),
sys_fgetxattr().

(Note: it's unclear to me why we are calling sys_*txattr() functions with
XATTR_VAL_BUF_SIZE-1 size instead of XATTR_VAL_BUF_SIZE ).

Only compile-tested!

Change-Id: Ief2103b56ba6c71e40ed343a93684eef6b771346
updates: bz#1193929
Signed-off-by: Yaniv Kaul &lt;ykaul@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>xlators/mgmt/glusterd/src/glusterd-volgen.c : reduce size of message variable</title>
<updated>2018-08-23T09:44:45+00:00</updated>
<author>
<name>Yaniv Kaul</name>
<email>ykaul@redhat.com</email>
</author>
<published>2018-08-16T11:20:19+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/commit/?id=cbee5397881ae9eff8fec5bf514233587919f68e'/>
<id>cbee5397881ae9eff8fec5bf514233587919f68e</id>
<content type='text'>
Size of error message variable reduced from 4096 bytes to 128 bytes.

Compile-tested only!

Change-Id: I08c87502be791e68ab767ed96657ac89ee77fae0
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>
Size of error message variable reduced from 4096 bytes to 128 bytes.

Compile-tested only!

Change-Id: I08c87502be791e68ab767ed96657ac89ee77fae0
updates: bz#1193929
Signed-off-by: Yaniv Kaul &lt;ykaul@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mgmt/glusterd: Code cleanup in glusterd-volgen.c</title>
<updated>2018-08-19T13:25:58+00:00</updated>
<author>
<name>Vijay Bellur</name>
<email>vbellur@redhat.com</email>
</author>
<published>2018-08-13T22:52:51+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/commit/?id=e7afbfb1cf65da96f3b57427b1bb61b2ebde5bba'/>
<id>e7afbfb1cf65da96f3b57427b1bb61b2ebde5bba</id>
<content type='text'>
This patch does the following:

1. Addresses CID: 1124815,124816,1124833,1291724,1325535,1325536,1357858
  - by adding some null checks
  - by handling return values from functions
  - by using an appropriate buffer length in strncpy

2. Cleans up some commented code

Change-Id: I5a7079f34e3e460d5a6267734c3bc84bf4ad72f5
updates: bz#789278
Signed-off-by: Vijay Bellur &lt;vbellur@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch does the following:

1. Addresses CID: 1124815,124816,1124833,1291724,1325535,1325536,1357858
  - by adding some null checks
  - by handling return values from functions
  - by using an appropriate buffer length in strncpy

2. Cleans up some commented code

Change-Id: I5a7079f34e3e460d5a6267734c3bc84bf4ad72f5
updates: bz#789278
Signed-off-by: Vijay Bellur &lt;vbellur@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mgmt/glusterd: Fix a memory leak in volgen</title>
<updated>2018-08-14T08:57:30+00:00</updated>
<author>
<name>Vijay Bellur</name>
<email>vbellur@redhat.com</email>
</author>
<published>2018-08-13T07:06:05+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/commit/?id=c43a52dd105f73d322124c56a901e084233f9630'/>
<id>c43a52dd105f73d322124c56a901e084233f9630</id>
<content type='text'>
Fixes CID 1325557

Change-Id: I5e33ae19ddf4c44a49a2b3b3dea0c739bc96d3a7
updates: bz#789278
Signed-off-by: Vijay Bellur &lt;vbellur@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes CID 1325557

Change-Id: I5e33ae19ddf4c44a49a2b3b3dea0c739bc96d3a7
updates: bz#789278
Signed-off-by: Vijay Bellur &lt;vbellur@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>All: run codespell on the code and fix issues.</title>
<updated>2018-07-22T14:40:16+00:00</updated>
<author>
<name>Yaniv Kaul</name>
<email>ykaul@redhat.com</email>
</author>
<published>2018-07-16T14:03:17+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/commit/?id=621138ce763eda8270d0a4f6d7209fd50ada8787'/>
<id>621138ce763eda8270d0a4f6d7209fd50ada8787</id>
<content type='text'>
Please review, it's not always just the comments that were fixed.
I've had to revert of course all calls to creat() that were changed
to create() ...

Only compile-tested!

Change-Id: I7d02e82d9766e272a7fd9cc68e51901d69e5aab5
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>
Please review, it's not always just the comments that were fixed.
I've had to revert of course all calls to creat() that were changed
to create() ...

Only compile-tested!

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