ocfs2-tools/0020-libocfs2-fix-ocfs2_init_dir-to-retain-indexed-flag.patch

41 lines
1.2 KiB
Diff

From 30a19b42c6da181fa3f96123041fb20e69d065d9 Mon Sep 17 00:00:00 2001
From: Mark Fasheh <mfasheh@suse.com>
Date: Tue, 20 Apr 2010 10:20:24 -0700
Subject: [PATCH 20/30] libocfs2: fix ocfs2_init_dir() to retain indexed flag
We were re-using the out of date 'cached inode' later in the function after
ocfs2_dx_dir_build() (which updates and writes out the inode internally).
As a result, ocfs2_init_dir() was accidentally clearing
OCFS2_INDEXED_DIR_FL. Fix this by refreshing the cache after the call to
ocfs2_dx_dir_build().
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
---
libocfs2/expanddir.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/libocfs2/expanddir.c b/libocfs2/expanddir.c
index eb18260..a81cfbe 100644
--- a/libocfs2/expanddir.c
+++ b/libocfs2/expanddir.c
@@ -242,6 +242,15 @@ errcode_t ocfs2_init_dir(ocfs2_filesys *fs,
ret = ocfs2_dx_dir_build(fs, dir);
if (ret)
goto bail;
+
+ /*
+ * Re-read the 'cached inode' as ocfs2_dx_dir_build()
+ * may have written out changes which won't be
+ * reflected in our copy.
+ */
+ ret = ocfs2_read_cached_inode(fs, dir, &cinode);
+ if (ret)
+ goto bail;
}
/* set link count of the parent */
--
1.7.0.2