summaryrefslogtreecommitdiffstats
path: root/xlators/features/snapview-client/src
diff options
context:
space:
mode:
authorKotresh HR <khiremat@redhat.com>2019-06-13 22:43:47 +0530
committerAmar Tumballi <amarts@redhat.com>2019-06-17 10:26:51 +0000
commit01846e7b9b0b92e4a10f5cbcc921bad90441660d (patch)
tree771f6bccf866b41c985209c8fa528835027dd78b /xlators/features/snapview-client/src
parentb460e58d07fac340b713778f979d23705a8b70ff (diff)
uss: Fix tar issue with ctime and uss enabled
Problem: If ctime and uss enabled, tar still complains with 'file changed as we read it' Cause: To clear nfs cache (gluster-nfs), the ctime was incremented in snap-view client on stat cbk. Fix: The ctime should not be incremented manually. Since gluster-nfs is planning to be deprecated, this code is being removed to fix the issue. Change-Id: Iae7f100c20fce880a50b008ba716077350281404 fixes: bz#1720290 Signed-off-by: Kotresh HR <khiremat@redhat.com>
Diffstat (limited to 'xlators/features/snapview-client/src')
-rw-r--r--xlators/features/snapview-client/src/snapview-client.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/xlators/features/snapview-client/src/snapview-client.c b/xlators/features/snapview-client/src/snapview-client.c
index 5d7986c7f0f..9c789ae447b 100644
--- a/xlators/features/snapview-client/src/snapview-client.c
+++ b/xlators/features/snapview-client/src/snapview-client.c
@@ -577,20 +577,24 @@ gf_svc_stat_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
int32_t op_ret, int32_t op_errno, struct iatt *buf,
dict_t *xdata)
{
- /* Consider a testcase:
+ /* TODO: FIX ME
+ * Consider a testcase:
* #mount -t nfs host1:/vol1 /mnt
* #ls /mnt
* #ls /mnt/.snaps (As expected this fails)
* #gluster volume set vol1 features.uss enable
- * Now `ls /mnt/.snaps` should work,
- * but fails with No such file or directory.
- * This is because NFS client caches the list of files in
- * a directory. This cache is updated if there are any changes
- * in the directory attributes. To solve this problem change
- * a attribute 'ctime' when USS is enabled
+ * Now `ls /mnt/.snaps` should work, but fails with No such file or
+ * directory. This is because NFS client (gNFS) caches the list of files
+ * in a directory. This cache is updated if there are any changes in the
+ * directory attributes. So, one way to solve this problem is to change
+ * 'ctime' attribute when USS is enabled as below.
+ *
+ * if (op_ret == 0 && IA_ISDIR(buf->ia_type))
+ * buf->ia_ctime_nsec++;
+ *
+ * But this is not the ideal solution as applications see the unexpected
+ * ctime change causing failures.
*/
- if (op_ret == 0 && IA_ISDIR(buf->ia_type))
- buf->ia_ctime_nsec++;
SVC_STACK_UNWIND(stat, frame, op_ret, op_errno, buf, xdata);
return 0;