glusterfs/0409-system-posix-acl-update-ctx-only-if-iatt-is-non-NULL.patch
Rinku Kothiya 14e44be7b0 autobuild v6.0-38
Resolves: bz#1234220 bz#1286171 bz#1487177 bz#1524457 bz#1640573
Resolves: bz#1663557 bz#1667954 bz#1683602 bz#1686897 bz#1721355
Resolves: bz#1748865 bz#1750211 bz#1754391 bz#1759875 bz#1761531
Resolves: bz#1761932 bz#1763124 bz#1763129 bz#1764091 bz#1775637
Resolves: bz#1776901 bz#1781550 bz#1781649 bz#1781710 bz#1783232
Resolves: bz#1784211 bz#1784415 bz#1786516 bz#1786681 bz#1787294
Resolves: bz#1787310 bz#1787331 bz#1787994 bz#1790336 bz#1792873
Resolves: bz#1794663 bz#1796814 bz#1804164 bz#1810924 bz#1815434
Resolves: bz#1836099 bz#1837467 bz#1837926 bz#1838479 bz#1839137
Resolves: bz#1844359
Signed-off-by: Rinku Kothiya <rkothiya@redhat.com>
2020-06-10 00:48:36 -04:00

53 lines
1.7 KiB
Diff

From a92b4f6373cb18544325436cf86abfebd6780d79 Mon Sep 17 00:00:00 2001
From: Homma <homma@allworks.co.jp>
Date: Fri, 5 Jul 2019 16:10:41 +0530
Subject: [PATCH 409/449] system/posix-acl: update ctx only if iatt is non-NULL
We need to safe-guard against possible zero'ing out of iatt
structure in acl ctx, which can cause many issues.
> upstream patch: https://review.gluster.org/#/c/glusterfs/+/23003/
> fixes: 1668286
> Change-Id: Ie81a57d7453a6624078de3be8c0845bf4d432773
> Signed-off-by: Amar Tumballi <amarts@redhat.com>
BUG: 1781649
Change-Id: I655b61551d30215b9f23cafc3ef9a5c0d98a43d0
Signed-off-by: Raghavendra M <raghavendra@redhat.com>
Reviewed-on: https://code.engineering.redhat.com/gerrit/202446
Tested-by: RHGS Build Bot <nigelb@redhat.com>
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
---
xlators/system/posix-acl/src/posix-acl.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/xlators/system/posix-acl/src/posix-acl.c b/xlators/system/posix-acl/src/posix-acl.c
index 38e48b8..c6ba281 100644
--- a/xlators/system/posix-acl/src/posix-acl.c
+++ b/xlators/system/posix-acl/src/posix-acl.c
@@ -875,6 +875,13 @@ posix_acl_ctx_update(inode_t *inode, xlator_t *this, struct iatt *buf,
int ret = 0;
int i = 0;
+ if (!buf || !buf->ia_ctime) {
+ /* No need to update ctx if buf is empty */
+ gf_log_callingfn(this->name, GF_LOG_DEBUG, "iatt struct is empty (%d)",
+ fop);
+ goto out;
+ }
+
LOCK(&inode->lock);
{
ctx = __posix_acl_ctx_get(inode, this, _gf_true);
@@ -928,6 +935,7 @@ posix_acl_ctx_update(inode_t *inode, xlator_t *this, struct iatt *buf,
}
unlock:
UNLOCK(&inode->lock);
+out:
return ret;
}
--
1.8.3.1