<feed xmlns='http://www.w3.org/2005/Atom'>
<title>glusterfs.git/xlators/features, branch release-7</title>
<subtitle></subtitle>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/'/>
<entry>
<title>features/bit-rot: invalid snprintf() buffer size</title>
<updated>2020-09-29T12:52:44+00:00</updated>
<author>
<name>Dmitry Antipov</name>
<email>dmantipov@yandex.ru</email>
</author>
<published>2020-05-06T05:29:48+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=12020998c285157e3c4ee6f17e709d35349e3e12'/>
<id>12020998c285157e3c4ee6f17e709d35349e3e12</id>
<content type='text'>
Found with clang-10 -Wfortify-source:

bit-rot-scrub.c:1802:15: warning: 'snprintf' size argument is too large;
destination buffer has size 32, but size argument is 4096 [-Wfortify-source]
        len = snprintf(key, PATH_MAX, "quarantine-%d", j);
              ^
bit-rot-scrub.c:1813:9: warning: 'snprintf' size argument is too large;
destination buffer has size 32, but size argument is 4096 [-Wfortify-source]
        snprintf(main_key, PATH_MAX, "quarantine-%d", tmp_count);

Change-Id: I9b9c09ef2223ed181d81215154345de976b82f13
Signed-off-by: Dmitry Antipov &lt;dmantipov@yandex.ru&gt;
Fixes: #1221
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Found with clang-10 -Wfortify-source:

bit-rot-scrub.c:1802:15: warning: 'snprintf' size argument is too large;
destination buffer has size 32, but size argument is 4096 [-Wfortify-source]
        len = snprintf(key, PATH_MAX, "quarantine-%d", j);
              ^
bit-rot-scrub.c:1813:9: warning: 'snprintf' size argument is too large;
destination buffer has size 32, but size argument is 4096 [-Wfortify-source]
        snprintf(main_key, PATH_MAX, "quarantine-%d", tmp_count);

Change-Id: I9b9c09ef2223ed181d81215154345de976b82f13
Signed-off-by: Dmitry Antipov &lt;dmantipov@yandex.ru&gt;
Fixes: #1221
</pre>
</div>
</content>
</entry>
<entry>
<title>features/shard: Convert shard block indices to uint64</title>
<updated>2020-07-13T06:43:52+00:00</updated>
<author>
<name>Krutika Dhananjay</name>
<email>kdhananj@redhat.com</email>
</author>
<published>2019-09-12T05:37:10+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=c5159b8da1462a8d56188bbec48be95b742a4709'/>
<id>c5159b8da1462a8d56188bbec48be95b742a4709</id>
<content type='text'>
This patch fixes a crash in FOPs that operate on really large sharded
files where number of participant shards could sometimes exceed
signed int32 max.

The patch also adds GF_ASSERTs to ensure that number of participating
shards is always greater than 0 for files that do have more than one
shard.

Change-Id: I354de58796f350eb1aa42fcdf8092ca2e69ccbb6
Fixes: #1348
Signed-off-by: Krutika Dhananjay &lt;kdhananj@redhat.com&gt;
(cherry picked from commit cdf01cc47eb2efb427b5855732d9607eec2abc8a)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch fixes a crash in FOPs that operate on really large sharded
files where number of participant shards could sometimes exceed
signed int32 max.

The patch also adds GF_ASSERTs to ensure that number of participating
shards is always greater than 0 for files that do have more than one
shard.

Change-Id: I354de58796f350eb1aa42fcdf8092ca2e69ccbb6
Fixes: #1348
Signed-off-by: Krutika Dhananjay &lt;kdhananj@redhat.com&gt;
(cherry picked from commit cdf01cc47eb2efb427b5855732d9607eec2abc8a)
</pre>
</div>
</content>
</entry>
<entry>
<title>features/shard: Aggregate file size, block-count before unwinding removexattr</title>
<updated>2020-07-13T06:29:35+00:00</updated>
<author>
<name>Krutika Dhananjay</name>
<email>kdhananj@redhat.com</email>
</author>
<published>2020-05-22T07:55:26+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=d8982b2eb65652d50bfc85bf8d9176301965305b'/>
<id>d8982b2eb65652d50bfc85bf8d9176301965305b</id>
<content type='text'>
Posix translator returns pre and postbufs in the dict in {F}REMOVEXATTR fops.
These iatts are further cached at layers like md-cache.
Shard translator, in its current state, simply returns these values without
updating the aggregated file size and block-count.

This patch fixes this problem.

Change-Id: I4b2dd41ede472c5829af80a67401ec5a6376d872
Fixes: #1243
Signed-off-by: Krutika Dhananjay &lt;kdhananj@redhat.com&gt;
(cherry picked from commit 32519525108a2ac6bcc64ad931dc8048d33d64de)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Posix translator returns pre and postbufs in the dict in {F}REMOVEXATTR fops.
These iatts are further cached at layers like md-cache.
Shard translator, in its current state, simply returns these values without
updating the aggregated file size and block-count.

This patch fixes this problem.

Change-Id: I4b2dd41ede472c5829af80a67401ec5a6376d872
Fixes: #1243
Signed-off-by: Krutika Dhananjay &lt;kdhananj@redhat.com&gt;
(cherry picked from commit 32519525108a2ac6bcc64ad931dc8048d33d64de)
</pre>
</div>
</content>
</entry>
<entry>
<title>features/shard: Aggregate size, block-count in iatt before unwinding setxattr</title>
<updated>2020-06-15T12:12:00+00:00</updated>
<author>
<name>Krutika Dhananjay</name>
<email>kdhananj@redhat.com</email>
</author>
<published>2020-05-15T05:59:36+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=cf7298e2db5a18cdba70b23a8e94952a2aed7280'/>
<id>cf7298e2db5a18cdba70b23a8e94952a2aed7280</id>
<content type='text'>
Posix translator returns pre and postbufs in the dict in {F}SETXATTR fops.
These iatts are further cached at layers like md-cache.
Shard translator, in its current state, simply returns these values without
updating the aggregated file size and block-count.

This patch fixes this problem.

Change-Id: I4da0eceb4235b91546df79270bcc0af8cd64e9ea
Fixes: #1243
Signed-off-by: Krutika Dhananjay &lt;kdhananj@redhat.com&gt;
(cherry picked from commit 29ec66c6ab77e2d6893c6e213a3d1fb148702c99)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Posix translator returns pre and postbufs in the dict in {F}SETXATTR fops.
These iatts are further cached at layers like md-cache.
Shard translator, in its current state, simply returns these values without
updating the aggregated file size and block-count.

This patch fixes this problem.

Change-Id: I4da0eceb4235b91546df79270bcc0af8cd64e9ea
Fixes: #1243
Signed-off-by: Krutika Dhananjay &lt;kdhananj@redhat.com&gt;
(cherry picked from commit 29ec66c6ab77e2d6893c6e213a3d1fb148702c99)
</pre>
</div>
</content>
</entry>
<entry>
<title>features/utime: Don't access frame after stack-wind</title>
<updated>2020-04-07T11:22:36+00:00</updated>
<author>
<name>Pranith Kumar K</name>
<email>pkarampu@redhat.com</email>
</author>
<published>2020-04-02T10:00:28+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=b0e61d5a15e61c7defd47781bf05a859b0145124'/>
<id>b0e61d5a15e61c7defd47781bf05a859b0145124</id>
<content type='text'>
Problem:
frame is accessed after stack-wind. This can lead to crash
if the cbk frees the frame.

Fix:
Use new frame for the wind instead.

Fixes: #832
Change-Id: I64754609f1114b0bbd4d1336fa81a56f2cca6e03
Signed-off-by: Pranith Kumar K &lt;pkarampu@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem:
frame is accessed after stack-wind. This can lead to crash
if the cbk frees the frame.

Fix:
Use new frame for the wind instead.

Fixes: #832
Change-Id: I64754609f1114b0bbd4d1336fa81a56f2cca6e03
Signed-off-by: Pranith Kumar K &lt;pkarampu@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>utime: resolve an issue of permission denied logs</title>
<updated>2020-04-07T11:14:40+00:00</updated>
<author>
<name>Amar Tumballi</name>
<email>amar@kadalu.io</email>
</author>
<published>2020-03-03T19:16:08+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=0a67613d683cd07aea8d91243db7ef2298f25921'/>
<id>0a67613d683cd07aea8d91243db7ef2298f25921</id>
<content type='text'>
In case where uid is not set to be 0, there are possible errors
from acl xlator. So, set `uid = 0;` with pid indicating this is
set from UTIME activity.

The message "E [MSGID: 148002] [utime.c:146:gf_utime_set_mdata_setxattr_cbk] 0-dev_SNIP_data-utime: dict set of key for set-ctime-mdata failed [Permission denied]" repeated 2 times between [2019-12-19 21:27:55.042634] and [2019-12-19 21:27:55.047887]

Change-Id: Ieadf329835a40a13ac0bf908dac776e66954466c
Updates: #832
Signed-off-by: Amar Tumballi &lt;amar@kadalu.io&gt;
(cherry picked from commit eb916c057036db8289b41265797e5dce066d1512)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In case where uid is not set to be 0, there are possible errors
from acl xlator. So, set `uid = 0;` with pid indicating this is
set from UTIME activity.

The message "E [MSGID: 148002] [utime.c:146:gf_utime_set_mdata_setxattr_cbk] 0-dev_SNIP_data-utime: dict set of key for set-ctime-mdata failed [Permission denied]" repeated 2 times between [2019-12-19 21:27:55.042634] and [2019-12-19 21:27:55.047887]

Change-Id: Ieadf329835a40a13ac0bf908dac776e66954466c
Updates: #832
Signed-off-by: Amar Tumballi &lt;amar@kadalu.io&gt;
(cherry picked from commit eb916c057036db8289b41265797e5dce066d1512)
</pre>
</div>
</content>
</entry>
<entry>
<title>features/shard: Fix crash during shards cleanup in error cases</title>
<updated>2020-04-07T11:11:25+00:00</updated>
<author>
<name>Krutika Dhananjay</name>
<email>kdhananj@redhat.com</email>
</author>
<published>2020-03-23T06:17:10+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=6909b249139679acc2ffb04486b5743b7bef8a10'/>
<id>6909b249139679acc2ffb04486b5743b7bef8a10</id>
<content type='text'>
A crash is seen during a reattempt to clean up shards in background
upon remount. And this happens even on remount (which means a remount
is no workaround for the crash).

In such a situation, the in-memory base inode object will not be
existent (new process, non-existent base shard).
So local-&gt;resolver_base_inode will be NULL.

In the event of an error (in this case, of space running out), the
process would crash at the time of logging the error in the following line -

        gf_msg(this-&gt;name, GF_LOG_ERROR, local-&gt;op_errno, SHARD_MSG_FOP_FAILED,
               "failed to delete shards of %s",
               uuid_utoa(local-&gt;resolver_base_inode-&gt;gfid));

Fixed that by using local-&gt;base_gfid as the source of gfid when
local-&gt;resolver_base_inode is NULL.

Change-Id: I0b49f2b58becd0d8874b3d4b14ff8d92a89d02d5
Fixes: #1127
Signed-off-by: Krutika Dhananjay &lt;kdhananj@redhat.com&gt;
(cherry picked from commit cc43ac8651de9aa508b01cb259b43c02d89b2afc)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A crash is seen during a reattempt to clean up shards in background
upon remount. And this happens even on remount (which means a remount
is no workaround for the crash).

In such a situation, the in-memory base inode object will not be
existent (new process, non-existent base shard).
So local-&gt;resolver_base_inode will be NULL.

In the event of an error (in this case, of space running out), the
process would crash at the time of logging the error in the following line -

        gf_msg(this-&gt;name, GF_LOG_ERROR, local-&gt;op_errno, SHARD_MSG_FOP_FAILED,
               "failed to delete shards of %s",
               uuid_utoa(local-&gt;resolver_base_inode-&gt;gfid));

Fixed that by using local-&gt;base_gfid as the source of gfid when
local-&gt;resolver_base_inode is NULL.

Change-Id: I0b49f2b58becd0d8874b3d4b14ff8d92a89d02d5
Fixes: #1127
Signed-off-by: Krutika Dhananjay &lt;kdhananj@redhat.com&gt;
(cherry picked from commit cc43ac8651de9aa508b01cb259b43c02d89b2afc)
</pre>
</div>
</content>
</entry>
<entry>
<title>multiple: fix bad type cast</title>
<updated>2020-03-16T08:21:00+00:00</updated>
<author>
<name>Xavi Hernandez</name>
<email>xhernandez@redhat.com</email>
</author>
<published>2019-12-20T13:14:32+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=dfaaace24d26d8e39f7783e99ac7440eafeced74'/>
<id>dfaaace24d26d8e39f7783e99ac7440eafeced74</id>
<content type='text'>
When using inode_ctx_get() or inode_ctx_set(), a 'uint64_t *' is expected.
In many cases, the value to retrieve or store is a pointer, which will be
of smaller size in some architectures (for example 32-bits). In this case,
directly passing the address of the pointer casted to an 'uint64_t *' is
wrong and can cause memory corruption.

Backport of:
&gt; Change-Id: Iae616da9dda528df6743fa2f65ae5cff5ad23258
&gt; Signed-off-by: Xavi Hernandez &lt;xhernandez@redhat.com&gt;
&gt; Fixes: bz#1785611

Change-Id: Iae616da9dda528df6743fa2f65ae5cff5ad23258
Signed-off-by: Xavi Hernandez &lt;xhernandez@redhat.com&gt;
Fixes: bz#1785323
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When using inode_ctx_get() or inode_ctx_set(), a 'uint64_t *' is expected.
In many cases, the value to retrieve or store is a pointer, which will be
of smaller size in some architectures (for example 32-bits). In this case,
directly passing the address of the pointer casted to an 'uint64_t *' is
wrong and can cause memory corruption.

Backport of:
&gt; Change-Id: Iae616da9dda528df6743fa2f65ae5cff5ad23258
&gt; Signed-off-by: Xavi Hernandez &lt;xhernandez@redhat.com&gt;
&gt; Fixes: bz#1785611

Change-Id: Iae616da9dda528df6743fa2f65ae5cff5ad23258
Signed-off-by: Xavi Hernandez &lt;xhernandez@redhat.com&gt;
Fixes: bz#1785323
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix possible resource leaks.</title>
<updated>2020-02-10T07:36:46+00:00</updated>
<author>
<name>Xi Jinyu</name>
<email>xijinyu@cmss.chinamobile.com</email>
</author>
<published>2020-01-15T03:29:06+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=f77a946ad947045a04a8be0989379b2c5b7d0e8e'/>
<id>f77a946ad947045a04a8be0989379b2c5b7d0e8e</id>
<content type='text'>
xlators/features/quota/src/quota.c quota_log_usage function.
The quota_log_helper() function applies memory
for path through inode_path(), should be GF_FREE().

Upstream Patch:
https://review.gluster.org/#/c/glusterfs/+/24018/

Backport of:

&gt;   fixes: bz#1792707
&gt;   Change-Id: I33143bdf272bf10837061df4a1b7b2fc146162d5
&gt;   Signed-off-by: Xi Jinyu &lt;xijinyu@cmss.chinamobile.com&gt;
&gt;   (cherry picked from commit 18549de12bcfafe4ac30fc2e11ad7a3f3c216b38)

fixes: bz#1791154
Change-Id: I33143bdf272bf10837061df4a1b7b2fc146162d5
Signed-off-by: Signed-off-by: Sunny Kumar &lt;sunkumar@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
xlators/features/quota/src/quota.c quota_log_usage function.
The quota_log_helper() function applies memory
for path through inode_path(), should be GF_FREE().

Upstream Patch:
https://review.gluster.org/#/c/glusterfs/+/24018/

Backport of:

&gt;   fixes: bz#1792707
&gt;   Change-Id: I33143bdf272bf10837061df4a1b7b2fc146162d5
&gt;   Signed-off-by: Xi Jinyu &lt;xijinyu@cmss.chinamobile.com&gt;
&gt;   (cherry picked from commit 18549de12bcfafe4ac30fc2e11ad7a3f3c216b38)

fixes: bz#1791154
Change-Id: I33143bdf272bf10837061df4a1b7b2fc146162d5
Signed-off-by: Signed-off-by: Sunny Kumar &lt;sunkumar@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>performance/md-cache: Do not skip caching of null character xattr values</title>
<updated>2019-12-19T12:42:32+00:00</updated>
<author>
<name>Anoop C S</name>
<email>anoopcs@redhat.com</email>
</author>
<published>2019-08-10T05:00:26+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=c1cb279649b3d0c4ba88dbf0ddfd179ce6f5798f'/>
<id>c1cb279649b3d0c4ba88dbf0ddfd179ce6f5798f</id>
<content type='text'>
Null character string is a valid xattr value in file system. But for
those xattrs processed by md-cache, it does not update its entries if
value is null('\0'). This results in ENODATA when those xattrs are
queried afterwards via getxattr() causing failures in basic operations
like create, copy etc in a specially configured Samba setup for Mac OS
clients.

On the other side snapview-server is internally setting empty string("")
as value for xattrs received as part of listxattr() and are not intended
to be cached. Therefore we try to maintain that behaviour using an
additional dictionary key to prevent updation of entries in getxattr()
and fgetxattr() callbacks in md-cache.

Credits: Poornima G &lt;pgurusid@redhat.com&gt;

Change-Id: I7859cbad0a06ca6d788420c2a495e658699c6ff7
Fixes: bz#1785228
Signed-off-by: Anoop C S &lt;anoopcs@redhat.com&gt;
(cherry picked from commit b4b683736367d93daad08a5ee6ca95778c07c5a4)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Null character string is a valid xattr value in file system. But for
those xattrs processed by md-cache, it does not update its entries if
value is null('\0'). This results in ENODATA when those xattrs are
queried afterwards via getxattr() causing failures in basic operations
like create, copy etc in a specially configured Samba setup for Mac OS
clients.

On the other side snapview-server is internally setting empty string("")
as value for xattrs received as part of listxattr() and are not intended
to be cached. Therefore we try to maintain that behaviour using an
additional dictionary key to prevent updation of entries in getxattr()
and fgetxattr() callbacks in md-cache.

Credits: Poornima G &lt;pgurusid@redhat.com&gt;

Change-Id: I7859cbad0a06ca6d788420c2a495e658699c6ff7
Fixes: bz#1785228
Signed-off-by: Anoop C S &lt;anoopcs@redhat.com&gt;
(cherry picked from commit b4b683736367d93daad08a5ee6ca95778c07c5a4)
</pre>
</div>
</content>
</entry>
</feed>
