cb8e9e
From c005cdaf42edda9e515cd3a7657635a16a332987 Mon Sep 17 00:00:00 2001
cb8e9e
From: Soumya Koduri <skoduri@redhat.com>
cb8e9e
Date: Thu, 25 Jun 2015 00:47:19 +0530
cb8e9e
Subject: [PATCH 179/190] Upcall: Fix an issue with invalidating parent entries
cb8e9e
cb8e9e
Any directory or file creation should result in cache-invalidation
cb8e9e
requests sent to parent directory. However that is not the case
cb8e9e
currently due to a bug while processing these requests in the
cb8e9e
upcall xlator. We need to do invalidation checks on parent inode.
cb8e9e
cb8e9e
Fixed the same. Also fixed an issue with null client entries while
cb8e9e
sending upcall notifications.
cb8e9e
cb8e9e
This is backport of the below upstream fix
cb8e9e
http://review.gluster.org/11387
cb8e9e
cb8e9e
Change-Id: I3da7c79091291ba36fd8f8ebcfebcd77a192f250
cb8e9e
BUG: 1235544
cb8e9e
Signed-off-by: Soumya Koduri <skoduri@redhat.com>
cb8e9e
Reviewed-on: https://code.engineering.redhat.com/gerrit/51717
cb8e9e
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
cb8e9e
Tested-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
cb8e9e
---
cb8e9e
 xlators/features/upcall/src/upcall.c |   16 ++++++++--------
cb8e9e
 1 files changed, 8 insertions(+), 8 deletions(-)
cb8e9e
cb8e9e
diff --git a/xlators/features/upcall/src/upcall.c b/xlators/features/upcall/src/upcall.c
cb8e9e
index 331db52..ceeb99c 100644
cb8e9e
--- a/xlators/features/upcall/src/upcall.c
cb8e9e
+++ b/xlators/features/upcall/src/upcall.c
cb8e9e
@@ -640,7 +640,7 @@ up_mkdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
cb8e9e
         }
cb8e9e
 
cb8e9e
         /* invalidate parent's entry too */
cb8e9e
-        flags = UP_PARENT_DENTRY_FLAGS;
cb8e9e
+        flags = UP_TIMES;
cb8e9e
         upcall_cache_invalidate (frame, this, client, local->inode, flags,
cb8e9e
                                  stbuf, postparent, NULL);
cb8e9e
 
cb8e9e
@@ -660,7 +660,7 @@ up_mkdir (call_frame_t *frame, xlator_t *this,
cb8e9e
 
cb8e9e
         EXIT_IF_UPCALL_OFF (this, out);
cb8e9e
 
cb8e9e
-        local = upcall_local_init (frame, this, loc->inode);
cb8e9e
+        local = upcall_local_init (frame, this, loc->parent);
cb8e9e
         if (!local) {
cb8e9e
                 op_errno = ENOMEM;
cb8e9e
                 goto err;
cb8e9e
@@ -702,7 +702,7 @@ up_create_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
cb8e9e
 
cb8e9e
         /* As its a new file create, no need of sending notification */
cb8e9e
         /* However invalidate parent's entry */
cb8e9e
-        flags = UP_PARENT_DENTRY_FLAGS;
cb8e9e
+        flags = UP_TIMES;
cb8e9e
         upcall_cache_invalidate (frame, this, client, local->inode, flags,
cb8e9e
                                  stbuf, postparent, NULL);
cb8e9e
 
cb8e9e
@@ -723,7 +723,7 @@ up_create (call_frame_t *frame, xlator_t *this,
cb8e9e
 
cb8e9e
         EXIT_IF_UPCALL_OFF (this, out);
cb8e9e
 
cb8e9e
-        local = upcall_local_init (frame, this, loc->inode);
cb8e9e
+        local = upcall_local_init (frame, this, loc->parent);
cb8e9e
 
cb8e9e
         if (!local) {
cb8e9e
                 op_errno = ENOMEM;
cb8e9e
@@ -1052,7 +1052,7 @@ up_mknod_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
cb8e9e
         }
cb8e9e
 
cb8e9e
         /* invalidate parent's entry too */
cb8e9e
-        flags = UP_PARENT_DENTRY_FLAGS;
cb8e9e
+        flags = UP_TIMES;
cb8e9e
         upcall_cache_invalidate (frame, this, client, local->inode, flags,
cb8e9e
                                  buf, postparent, NULL);
cb8e9e
 
cb8e9e
@@ -1072,7 +1072,7 @@ up_mknod (call_frame_t *frame, xlator_t *this, loc_t *loc,
cb8e9e
 
cb8e9e
         EXIT_IF_UPCALL_OFF (this, out);
cb8e9e
 
cb8e9e
-        local = upcall_local_init (frame, this, loc->inode);
cb8e9e
+        local = upcall_local_init (frame, this, loc->parent);
cb8e9e
         if (!local) {
cb8e9e
                 op_errno = ENOMEM;
cb8e9e
                 goto err;
cb8e9e
@@ -1113,7 +1113,7 @@ up_symlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
cb8e9e
         }
cb8e9e
 
cb8e9e
         /* invalidate parent's entry too */
cb8e9e
-        flags = UP_PARENT_DENTRY_FLAGS;
cb8e9e
+        flags = UP_TIMES;
cb8e9e
         upcall_cache_invalidate (frame, this, client, local->inode, flags,
cb8e9e
                                  buf, postparent, NULL);
cb8e9e
 
cb8e9e
@@ -1134,7 +1134,7 @@ up_symlink (call_frame_t   *frame, xlator_t *this,
cb8e9e
 
cb8e9e
         EXIT_IF_UPCALL_OFF (this, out);
cb8e9e
 
cb8e9e
-        local = upcall_local_init (frame, this, loc->inode);
cb8e9e
+        local = upcall_local_init (frame, this, loc->parent);
cb8e9e
         if (!local) {
cb8e9e
                 op_errno = ENOMEM;
cb8e9e
                 goto err;
cb8e9e
-- 
cb8e9e
1.7.1
cb8e9e