<feed xmlns='http://www.w3.org/2005/Atom'>
<title>glusterfs.git/xlators/nfs/server, branch v5.4</title>
<subtitle></subtitle>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/'/>
<entry>
<title>build: cleanup xlator link, --no-undefined, libuuid</title>
<updated>2018-09-12T14:38:13+00:00</updated>
<author>
<name>Kaleb S. KEITHLEY</name>
<email>kkeithle@redhat.com</email>
</author>
<published>2018-09-11T18:17:02+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=f15e948da3881b61a8b546af7c64340db87d3cf7'/>
<id>f15e948da3881b61a8b546af7c64340db87d3cf7</id>
<content type='text'>
While attempting to build a (pre-)5.0 of glusterfs on Ubuntu
bionic and cosmic, it became apparent that there are some gremlins
hiding in the combination of the xlator export-symbols, the newish
addition of -Wl,--no-undefined, and the new switch to libuuid from
the old contrib/uuid.

Note: even though Fedora 28 (and later) and Ubuntu bionic (and
later) have the same nominal version of libtool, the Fedora version
appears to do a better job of recursing through dependencies to
determine the libraries to link with.

Examination of the build logs showed that despite appearing to work
on Fedora, not all xlators and shared libs were linked with -Wl,
--no-undefined, and -luuid. And in the case of the gnfs xlator, it
was not only not linked with -Wl,--no-undefined but alsos not linked
with -lgfxdr and -lgfrpc.

Added GF_XLATOR_LDFLAGS, similar to GF_XLATOR_DEFAULT_LDFLAGS.
GF_XLATOR_DEFAULT_LDFLAGS is for xlators that export/expose the
default or common set of symbols. GF_XLATOR_LDFLAGS is for those
remaining xlators that export/expose non-default symbols, e.g. dht
and glupy. This removes the need in the future to add things like
$(UUID_LIBS) to every xlator's Makefile.am. Just add it to
GF_XLATOR_LDFLAGS and GF_XLATOR_DEFAULT_LDFLAGS in configure.ac
and you're done.

This patch was tested on Fedora 28 (build, rpmbuild), Fedora
Rawhide/30 (rpmbuild), RHEL8 (rpmbuild), CentOS7 (rpmbuild), Fedora
koji --scratch build for f30/rawhide, and a Launchpad build for
Ubuntu cosmic/18.10.

Change-Id: Ieca104fa5c5d3c094e701c8ca4a73754dd0292b0
updates: bz#1193929
Signed-off-by: Kaleb S. KEITHLEY &lt;kkeithle@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
While attempting to build a (pre-)5.0 of glusterfs on Ubuntu
bionic and cosmic, it became apparent that there are some gremlins
hiding in the combination of the xlator export-symbols, the newish
addition of -Wl,--no-undefined, and the new switch to libuuid from
the old contrib/uuid.

Note: even though Fedora 28 (and later) and Ubuntu bionic (and
later) have the same nominal version of libtool, the Fedora version
appears to do a better job of recursing through dependencies to
determine the libraries to link with.

Examination of the build logs showed that despite appearing to work
on Fedora, not all xlators and shared libs were linked with -Wl,
--no-undefined, and -luuid. And in the case of the gnfs xlator, it
was not only not linked with -Wl,--no-undefined but alsos not linked
with -lgfxdr and -lgfrpc.

Added GF_XLATOR_LDFLAGS, similar to GF_XLATOR_DEFAULT_LDFLAGS.
GF_XLATOR_DEFAULT_LDFLAGS is for xlators that export/expose the
default or common set of symbols. GF_XLATOR_LDFLAGS is for those
remaining xlators that export/expose non-default symbols, e.g. dht
and glupy. This removes the need in the future to add things like
$(UUID_LIBS) to every xlator's Makefile.am. Just add it to
GF_XLATOR_LDFLAGS and GF_XLATOR_DEFAULT_LDFLAGS in configure.ac
and you're done.

This patch was tested on Fedora 28 (build, rpmbuild), Fedora
Rawhide/30 (rpmbuild), RHEL8 (rpmbuild), CentOS7 (rpmbuild), Fedora
koji --scratch build for f30/rawhide, and a Launchpad build for
Ubuntu cosmic/18.10.

Change-Id: Ieca104fa5c5d3c094e701c8ca4a73754dd0292b0
updates: bz#1193929
Signed-off-by: Kaleb S. KEITHLEY &lt;kkeithle@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://dev.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>Land clang-format changes</title>
<updated>2018-09-12T11:52:48+00:00</updated>
<author>
<name>Gluster Ant</name>
<email>bugzilla-bot@gluster.org</email>
</author>
<published>2018-09-12T11:52:48+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=45a71c0548b6fd2c757aa2e7b7671a1411948894'/>
<id>45a71c0548b6fd2c757aa2e7b7671a1411948894</id>
<content type='text'>
Change-Id: I6f5d8140a06f3c1b2d196849299f8d483028d33b
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change-Id: I6f5d8140a06f3c1b2d196849299f8d483028d33b
</pre>
</div>
</content>
</entry>
<entry>
<title>{dht-rebalance|glusterd-geo-rep|glusterd-utils|nfs|bd}.c: no dict_del before dict_set</title>
<updated>2018-09-04T05:32:10+00:00</updated>
<author>
<name>Yaniv Kaul</name>
<email>ykaul@redhat.com</email>
</author>
<published>2018-08-19T05:08:23+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=8b913eb752be422a362329d02dfb5c76754ad151'/>
<id>8b913eb752be422a362329d02dfb5c76754ad151</id>
<content type='text'>
There is no need to remove an item before re-setting it.

Compile-tested only!

Change-Id: I2869aec9ebf474859127b8b38d284246e6097e84
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>
There is no need to remove an item before re-setting it.

Compile-tested only!

Change-Id: I2869aec9ebf474859127b8b38d284246e6097e84
updates: bz#1193929
Signed-off-by: Yaniv Kaul &lt;ykaul@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Multiple files: calloc -&gt; malloc</title>
<updated>2018-09-04T04:58:14+00:00</updated>
<author>
<name>Yaniv Kaul</name>
<email>ykaul@redhat.com</email>
</author>
<published>2018-08-04T06:51:26+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=81cbbfd1d870bea49b8aafe7bebb9e8251190918'/>
<id>81cbbfd1d870bea49b8aafe7bebb9e8251190918</id>
<content type='text'>
xlators/storage/posix/src/posix-inode-fd-ops.c:
xlators/storage/posix/src/posix-helpers.c:
xlators/storage/bd/src/bd.c:
xlators/protocol/client/src/client-lk.c:
xlators/performance/quick-read/src/quick-read.c:
xlators/performance/io-cache/src/page.c
xlators/nfs/server/src/nfs3-helpers.c
xlators/nfs/server/src/nfs-fops.c
xlators/nfs/server/src/mount3udp_svc.c
xlators/nfs/server/src/mount3.c
xlators/mount/fuse/src/fuse-helpers.c
xlators/mount/fuse/src/fuse-bridge.c
xlators/mgmt/glusterd/src/glusterd-utils.c
xlators/mgmt/glusterd/src/glusterd-syncop.h
xlators/mgmt/glusterd/src/glusterd-snapshot.c
xlators/mgmt/glusterd/src/glusterd-rpc-ops.c
xlators/mgmt/glusterd/src/glusterd-replace-brick.c
xlators/mgmt/glusterd/src/glusterd-op-sm.c
xlators/mgmt/glusterd/src/glusterd-mgmt.c
xlators/meta/src/subvolumes-dir.c
xlators/meta/src/graph-dir.c
xlators/features/trash/src/trash.c
xlators/features/shard/src/shard.h
xlators/features/shard/src/shard.c
xlators/features/marker/src/marker-quota.c
xlators/features/locks/src/common.c
xlators/features/leases/src/leases-internal.c
xlators/features/gfid-access/src/gfid-access.c
xlators/features/cloudsync/src/cloudsync-plugins/src/cloudsyncs3/src/libcloudsyncs3.c
xlators/features/bit-rot/src/bitd/bit-rot.c
xlators/features/bit-rot/src/bitd/bit-rot-scrub.c
bxlators/encryption/crypt/src/metadata.c
xlators/encryption/crypt/src/crypt.c
xlators/performance/md-cache/src/md-cache.c:

Move to GF_MALLOC() instead of GF_CALLOC() when possible

It doesn't make sense to calloc (allocate and clear) memory
when the code right away fills that memory with data.
It may be optimized by the compiler, or have a microscopic
performance improvement.

In some cases, also changed allocation size to be sizeof some
struct or type instead of a pointer - easier to read.
In some cases, removed redundant strlen() calls by saving the result
into a variable.

1. Only done for the straightforward cases. There's room for improvement.
2. Please review carefully, especially for string allocation, with the
terminating NULL string.

Only compile-tested!

.. and allocate memory as much as needed.

xlators/nfs/server/src/mount3.c :

Don't blindly allocate PATH_MAX, but strlen() the string and allocate
appropriately.
Also, align error messges.

updates: bz#1193929
Original-Author: Yaniv Kaul &lt;ykaul@redhat.com&gt;
Signed-off-by: Yaniv Kaul &lt;ykaul@redhat.com&gt;
Signed-off-by: Yaniv Kaul &lt;ykaul@redhat.com&gt;
Change-Id: Ibda6f33dd180b7f7694f20a12af1e9576fe197f5
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
xlators/storage/posix/src/posix-inode-fd-ops.c:
xlators/storage/posix/src/posix-helpers.c:
xlators/storage/bd/src/bd.c:
xlators/protocol/client/src/client-lk.c:
xlators/performance/quick-read/src/quick-read.c:
xlators/performance/io-cache/src/page.c
xlators/nfs/server/src/nfs3-helpers.c
xlators/nfs/server/src/nfs-fops.c
xlators/nfs/server/src/mount3udp_svc.c
xlators/nfs/server/src/mount3.c
xlators/mount/fuse/src/fuse-helpers.c
xlators/mount/fuse/src/fuse-bridge.c
xlators/mgmt/glusterd/src/glusterd-utils.c
xlators/mgmt/glusterd/src/glusterd-syncop.h
xlators/mgmt/glusterd/src/glusterd-snapshot.c
xlators/mgmt/glusterd/src/glusterd-rpc-ops.c
xlators/mgmt/glusterd/src/glusterd-replace-brick.c
xlators/mgmt/glusterd/src/glusterd-op-sm.c
xlators/mgmt/glusterd/src/glusterd-mgmt.c
xlators/meta/src/subvolumes-dir.c
xlators/meta/src/graph-dir.c
xlators/features/trash/src/trash.c
xlators/features/shard/src/shard.h
xlators/features/shard/src/shard.c
xlators/features/marker/src/marker-quota.c
xlators/features/locks/src/common.c
xlators/features/leases/src/leases-internal.c
xlators/features/gfid-access/src/gfid-access.c
xlators/features/cloudsync/src/cloudsync-plugins/src/cloudsyncs3/src/libcloudsyncs3.c
xlators/features/bit-rot/src/bitd/bit-rot.c
xlators/features/bit-rot/src/bitd/bit-rot-scrub.c
bxlators/encryption/crypt/src/metadata.c
xlators/encryption/crypt/src/crypt.c
xlators/performance/md-cache/src/md-cache.c:

Move to GF_MALLOC() instead of GF_CALLOC() when possible

It doesn't make sense to calloc (allocate and clear) memory
when the code right away fills that memory with data.
It may be optimized by the compiler, or have a microscopic
performance improvement.

In some cases, also changed allocation size to be sizeof some
struct or type instead of a pointer - easier to read.
In some cases, removed redundant strlen() calls by saving the result
into a variable.

1. Only done for the straightforward cases. There's room for improvement.
2. Please review carefully, especially for string allocation, with the
terminating NULL string.

Only compile-tested!

.. and allocate memory as much as needed.

xlators/nfs/server/src/mount3.c :

Don't blindly allocate PATH_MAX, but strlen() the string and allocate
appropriately.
Also, align error messges.

updates: bz#1193929
Original-Author: Yaniv Kaul &lt;ykaul@redhat.com&gt;
Signed-off-by: Yaniv Kaul &lt;ykaul@redhat.com&gt;
Signed-off-by: Yaniv Kaul &lt;ykaul@redhat.com&gt;
Change-Id: Ibda6f33dd180b7f7694f20a12af1e9576fe197f5
</pre>
</div>
</content>
</entry>
<entry>
<title>NFS server (mount3.c, nfs-inodes.c): strncpy()-&gt;sprintf(), reduce strlen()'s</title>
<updated>2018-08-31T06:17:20+00:00</updated>
<author>
<name>Yaniv Kaul</name>
<email>ykaul@redhat.com</email>
</author>
<published>2018-08-21T17:29:17+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=cd1051789361bd07e248baf1bf0fbbe479cd4ae1'/>
<id>cd1051789361bd07e248baf1bf0fbbe479cd4ae1</id>
<content type='text'>
xlators/nfs/server/src/mount3.c
xlators/nfs/server/src/nfs-inodes.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().

Compile-tested only!

Change-Id: Ibe74ccdb67434e9a10fc1f21c0b4cd5e4b8cb589
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/nfs/server/src/mount3.c
xlators/nfs/server/src/nfs-inodes.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().

Compile-tested only!

Change-Id: Ibe74ccdb67434e9a10fc1f21c0b4cd5e4b8cb589
updates: bz#1193929
Signed-off-by: Yaniv Kaul &lt;ykaul@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>nfs-server : fix few coverity issues in mount3.c</title>
<updated>2018-08-31T01:23:29+00:00</updated>
<author>
<name>Sunny Kumar</name>
<email>sunkumar@redhat.com</email>
</author>
<published>2018-08-27T10:41:03+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=a654ae2442899348aae136365786dc44a9f502ca'/>
<id>a654ae2442899348aae136365786dc44a9f502ca</id>
<content type='text'>
This patch fixes 1388767 and 1389057.

Change-Id: Id4ee7c3cd72e46112315f6dccb08e76788b40d27
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 1388767 and 1389057.

Change-Id: Id4ee7c3cd72e46112315f6dccb08e76788b40d27
updates: bz#789278
Signed-off-by: Sunny Kumar &lt;sunkumar@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>gnfs: fix gcc warnings</title>
<updated>2018-08-20T03:02:29+00:00</updated>
<author>
<name>Ravishankar N</name>
<email>ravishankar@redhat.com</email>
</author>
<published>2018-08-16T02:46:54+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=e924d76b125d50447535681e4525485379d45eeb'/>
<id>e924d76b125d50447535681e4525485379d45eeb</id>
<content type='text'>
gcc version 8.1.1 20180712 (Red Hat 8.1.1-5) (GCC) on Fedora 28.

Sample warnings:
1)
nfs3.c:292:54: warning: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size between 143 and 250 [-Wformat-truncation=]
                         snprintf (buf, sizeof (buf), "(%s) %s : %s",    \
                                                      ^~~~~~~~~~~~~~
nfs3.c:295:35:
                                   gfid);                                \
                                   ~~~~
2)
nlm4.c:145:54: warning: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size between 143 and 250 [-Wformat-truncation=]
                         snprintf (buf, sizeof (buf), "(%s) %s : %s",    \
                                                      ^~~~~~~~~~~~~~
nlm4.c:148:35:
                                   gfid);                                \
                                   ~~~~
acl3.c:128:54: warning: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size between 143 and 250 [-Wformat-truncation=]
                         snprintf (buf, sizeof (buf), "(%s) %s : %s",    \
                                                      ^~~~~~~~~~~~~~
acl3.c:131:35:
                                   gfid);                                \
                                   ~~~~

updates: bz#1193929
Change-Id: I760b8176e48f1f4628a1a98afa54a7994bdf13e9
Signed-off-by: Ravishankar N &lt;ravishankar@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
gcc version 8.1.1 20180712 (Red Hat 8.1.1-5) (GCC) on Fedora 28.

Sample warnings:
1)
nfs3.c:292:54: warning: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size between 143 and 250 [-Wformat-truncation=]
                         snprintf (buf, sizeof (buf), "(%s) %s : %s",    \
                                                      ^~~~~~~~~~~~~~
nfs3.c:295:35:
                                   gfid);                                \
                                   ~~~~
2)
nlm4.c:145:54: warning: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size between 143 and 250 [-Wformat-truncation=]
                         snprintf (buf, sizeof (buf), "(%s) %s : %s",    \
                                                      ^~~~~~~~~~~~~~
nlm4.c:148:35:
                                   gfid);                                \
                                   ~~~~
acl3.c:128:54: warning: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size between 143 and 250 [-Wformat-truncation=]
                         snprintf (buf, sizeof (buf), "(%s) %s : %s",    \
                                                      ^~~~~~~~~~~~~~
acl3.c:131:35:
                                   gfid);                                \
                                   ~~~~

updates: bz#1193929
Change-Id: I760b8176e48f1f4628a1a98afa54a7994bdf13e9
Signed-off-by: Ravishankar N &lt;ravishankar@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>nfs-server-mount : fix coverity issues in mount3.c</title>
<updated>2018-08-17T03:06:41+00:00</updated>
<author>
<name>Sunny Kumar</name>
<email>sunkumar@redhat.com</email>
</author>
<published>2018-08-09T21:09:55+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=1909f2ca01efcd467164a2d7ed684cdc6e1437de'/>
<id>1909f2ca01efcd467164a2d7ed684cdc6e1437de</id>
<content type='text'>
Fixes CID 1389033, 1388767, 1288782.

Change-Id: I244f88b2ca8487f8926da45d886982558ad45c7a
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>
Fixes CID 1389033, 1388767, 1288782.

Change-Id: I244f88b2ca8487f8926da45d886982558ad45c7a
updates: bz#789278
Signed-off-by: Sunny Kumar &lt;sunkumar@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://dev.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>
</feed>
