summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSoumya Koduri <skoduri@redhat.com>2015-06-25 00:47:19 +0530
committerKaleb KEITHLEY <kkeithle@redhat.com>2015-06-27 02:53:50 -0700
commit00df024959b3f47b7027d51a5f182b108a4e501f (patch)
treea577a14a7ed58040fa6baa339c0bc1f1b968bb2b
parentcb578de65bd7e03882dd4f48fe65b29935a426e0 (diff)
Upcall: Fix an issue with invalidating parent entries
Any directory or file creation should result in cache-invalidation requests sent to parent directory. However that is not the case currently due to a bug while processing these requests in the upcall xlator. We need to do invalidation checks on parent inode. Fixed the same. Also fixed an issue with null client entries while sending upcall notifications. This is backport of the below fix - http://review.gluster.org/#/c/11387/ Change-Id: I3da7c79091291ba36fd8f8ebcfebcd77a192f250 BUG: 1236274 Signed-off-by: Soumya Koduri <skoduri@redhat.com> Reviewed-on: http://review.gluster.org/11387 Reviewed-by: Niels de Vos <ndevos@redhat.com> Reviewed-by: Meghana M <mmadhusu@redhat.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Reviewed-on: http://review.gluster.org/11440 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com>
-rw-r--r--xlators/features/upcall/src/upcall.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/xlators/features/upcall/src/upcall.c b/xlators/features/upcall/src/upcall.c
index 331db52d9ac..ceeb99c82c7 100644
--- a/xlators/features/upcall/src/upcall.c
+++ b/xlators/features/upcall/src/upcall.c
@@ -640,7 +640,7 @@ up_mkdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
}
/* invalidate parent's entry too */
- flags = UP_PARENT_DENTRY_FLAGS;
+ flags = UP_TIMES;
upcall_cache_invalidate (frame, this, client, local->inode, flags,
stbuf, postparent, NULL);
@@ -660,7 +660,7 @@ up_mkdir (call_frame_t *frame, xlator_t *this,
EXIT_IF_UPCALL_OFF (this, out);
- local = upcall_local_init (frame, this, loc->inode);
+ local = upcall_local_init (frame, this, loc->parent);
if (!local) {
op_errno = ENOMEM;
goto err;
@@ -702,7 +702,7 @@ up_create_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
/* As its a new file create, no need of sending notification */
/* However invalidate parent's entry */
- flags = UP_PARENT_DENTRY_FLAGS;
+ flags = UP_TIMES;
upcall_cache_invalidate (frame, this, client, local->inode, flags,
stbuf, postparent, NULL);
@@ -723,7 +723,7 @@ up_create (call_frame_t *frame, xlator_t *this,
EXIT_IF_UPCALL_OFF (this, out);
- local = upcall_local_init (frame, this, loc->inode);
+ local = upcall_local_init (frame, this, loc->parent);
if (!local) {
op_errno = ENOMEM;
@@ -1052,7 +1052,7 @@ up_mknod_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
}
/* invalidate parent's entry too */
- flags = UP_PARENT_DENTRY_FLAGS;
+ flags = UP_TIMES;
upcall_cache_invalidate (frame, this, client, local->inode, flags,
buf, postparent, NULL);
@@ -1072,7 +1072,7 @@ up_mknod (call_frame_t *frame, xlator_t *this, loc_t *loc,
EXIT_IF_UPCALL_OFF (this, out);
- local = upcall_local_init (frame, this, loc->inode);
+ local = upcall_local_init (frame, this, loc->parent);
if (!local) {
op_errno = ENOMEM;
goto err;
@@ -1113,7 +1113,7 @@ up_symlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
}
/* invalidate parent's entry too */
- flags = UP_PARENT_DENTRY_FLAGS;
+ flags = UP_TIMES;
upcall_cache_invalidate (frame, this, client, local->inode, flags,
buf, postparent, NULL);
@@ -1134,7 +1134,7 @@ up_symlink (call_frame_t *frame, xlator_t *this,
EXIT_IF_UPCALL_OFF (this, out);
- local = upcall_local_init (frame, this, loc->inode);
+ local = upcall_local_init (frame, this, loc->parent);
if (!local) {
op_errno = ENOMEM;
goto err;