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