From 20fa80057eb430fd72b4fa31b9b65598b8ec1265 Mon Sep 17 00:00:00 2001 From: Ravishankar N Date: Wed, 20 Sep 2017 12:16:06 +0530 Subject: afr: heal gfid as a part of entry heal Problem: If a brick crashes after an entry (file or dir) is created but before gfid is assigned, the good bricks will have pending entry heal xattrs but the heal won't complete because afr_selfheal_recreate_entry() tries to create the entry again and it fails with EEXIST. Fix: We could have fixed posx_mknod/mkdir etc to assign the gfid if the file already exists but the right thing to do seems to be to trigger a lookup on the bad brick and let it heal the gfid instead of winding an mknod/mkdir in the first place. Change-Id: I82f76665a7541f1893ef8d847b78af6466aff1ff BUG: 1493415 Signed-off-by: Ravishankar N --- xlators/cluster/afr/src/afr-self-heal.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'xlators/cluster/afr/src/afr-self-heal.h') diff --git a/xlators/cluster/afr/src/afr-self-heal.h b/xlators/cluster/afr/src/afr-self-heal.h index b54da1facfd..8b0047df28f 100644 --- a/xlators/cluster/afr/src/afr-self-heal.h +++ b/xlators/cluster/afr/src/afr-self-heal.h @@ -110,6 +110,10 @@ afr_selfheal_metadata (call_frame_t *frame, xlator_t *this, inode_t *inode); int afr_selfheal_entry (call_frame_t *frame, xlator_t *this, inode_t *inode); +int +afr_lookup_and_heal_gfid (xlator_t *this, inode_t *parent, const char *name, + inode_t *inode, struct afr_reply *replies, int source, + void *gfid); int afr_selfheal_inodelk (call_frame_t *frame, xlator_t *this, inode_t *inode, -- cgit