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