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