From 25690197a6af67669346892c36cca471805b9305 Mon Sep 17 00:00:00 2001 From: N Balachandran Date: Thu, 29 Mar 2018 18:23:13 +0530 Subject: cluster/dht: Update layout in inode only on success With lookup-optimize enabled, gf_defrag_settle_hash in rebalance sometimes flips the on-disk layout on volume root post the migration of all files in the directory. This is sometimes seen when attempting to fix the layout of a directory multiple times before calling gf_defrag_settle_hash. dht_fix_layout_of_directory generates a new layout in memory but updates it in the inode ctx before it is set on disk. The layout may be different the second time around due to dht_selfheal_layout_maximize_overlap. If the layout is then not written to the disk, the inode now contains the wrong layout. gf_defrag_settle_hash does not check the correctness of the layout in the inode before updating the commit-hash and writing it to the disk thus changing the layout of the directory. Change-Id: Ie1407d92982518f2a0c40ec70ad370b34a87b4d4 updates: bz#1557435 Signed-off-by: N Balachandran --- xlators/cluster/dht/src/dht-selfheal.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'xlators/cluster/dht/src/dht-selfheal.c') diff --git a/xlators/cluster/dht/src/dht-selfheal.c b/xlators/cluster/dht/src/dht-selfheal.c index 4762f25067f..d3163fd1cfc 100644 --- a/xlators/cluster/dht/src/dht-selfheal.c +++ b/xlators/cluster/dht/src/dht-selfheal.c @@ -2000,9 +2000,6 @@ dht_fix_layout_of_directory (call_frame_t *frame, loc_t *loc, } done: if (new_layout) { - /* Now that the new layout has all the proper layout, change the - inode context */ - dht_layout_set (this, loc->inode, new_layout); /* Make sure the extra 'ref' for existing layout is removed */ dht_layout_unref (this, local->layout); -- cgit