f338ef
From 71ff9b7c6356e521d98ee025554b63dd23db9836 Mon Sep 17 00:00:00 2001
f338ef
From: Kotresh HR <khiremat@redhat.com>
f338ef
Date: Thu, 13 Jun 2019 22:43:47 +0530
f338ef
Subject: [PATCH 217/221] uss: Fix tar issue with ctime and uss enabled
f338ef
f338ef
Problem:
f338ef
If ctime and uss enabled, tar still complains with 'file
f338ef
changed as we read it'
f338ef
f338ef
Cause:
f338ef
To clear nfs cache (gluster-nfs), the ctime was incremented
f338ef
in snap-view client on stat cbk.
f338ef
f338ef
Fix:
f338ef
The ctime should not be incremented manually. Since gluster-nfs
f338ef
is planning to be deprecated, this code is being removed to
f338ef
fix the issue.
f338ef
f338ef
Backport of:
f338ef
 > Patch: https://review.gluster.org/22861
f338ef
 > Change-Id: Iae7f100c20fce880a50b008ba716077350281404
f338ef
 > fixes: bz#1720290
f338ef
 > Signed-off-by: Kotresh HR <khiremat@redhat.com>
f338ef
f338ef
Change-Id: Iae7f100c20fce880a50b008ba716077350281404
f338ef
BUG: 1709301
f338ef
Signed-off-by: Kotresh HR <khiremat@redhat.com>
f338ef
Reviewed-on: https://code.engineering.redhat.com/gerrit/173922
f338ef
Tested-by: RHGS Build Bot <nigelb@redhat.com>
f338ef
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
f338ef
---
f338ef
 .../features/snapview-client/src/snapview-client.c | 22 +++++++++++++---------
f338ef
 1 file changed, 13 insertions(+), 9 deletions(-)
f338ef
f338ef
diff --git a/xlators/features/snapview-client/src/snapview-client.c b/xlators/features/snapview-client/src/snapview-client.c
f338ef
index 5d7986c..9c789ae 100644
f338ef
--- a/xlators/features/snapview-client/src/snapview-client.c
f338ef
+++ b/xlators/features/snapview-client/src/snapview-client.c
f338ef
@@ -577,20 +577,24 @@ gf_svc_stat_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
f338ef
                 int32_t op_ret, int32_t op_errno, struct iatt *buf,
f338ef
                 dict_t *xdata)
f338ef
 {
f338ef
-    /* Consider a testcase:
f338ef
+    /* TODO: FIX ME
f338ef
+     * Consider a testcase:
f338ef
      * #mount -t nfs host1:/vol1 /mnt
f338ef
      * #ls /mnt
f338ef
      * #ls /mnt/.snaps (As expected this fails)
f338ef
      * #gluster volume set vol1 features.uss enable
f338ef
-     * Now `ls /mnt/.snaps` should work,
f338ef
-     * but fails with No such file or directory.
f338ef
-     * This is because NFS client caches the list of files in
f338ef
-     * a directory. This cache is updated if there are any changes
f338ef
-     * in the directory attributes. To solve this problem change
f338ef
-     * a attribute 'ctime' when USS is enabled
f338ef
+     * Now `ls /mnt/.snaps` should work, but fails with No such file or
f338ef
+     * directory. This is because NFS client (gNFS) caches the list of files
f338ef
+     * in a directory. This cache is updated if there are any changes in the
f338ef
+     * directory attributes. So, one way to solve this problem is to change
f338ef
+     * 'ctime' attribute when USS is enabled as below.
f338ef
+     *
f338ef
+     * if (op_ret == 0 && IA_ISDIR(buf->ia_type))
f338ef
+     *     buf->ia_ctime_nsec++;
f338ef
+     *
f338ef
+     * But this is not the ideal solution as applications see the unexpected
f338ef
+     * ctime change causing failures.
f338ef
      */
f338ef
-    if (op_ret == 0 && IA_ISDIR(buf->ia_type))
f338ef
-        buf->ia_ctime_nsec++;
f338ef
 
f338ef
     SVC_STACK_UNWIND(stat, frame, op_ret, op_errno, buf, xdata);
f338ef
     return 0;
f338ef
-- 
f338ef
1.8.3.1
f338ef