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