[Ocfs2-tools-devel] [PATCH 5/5] Don't account space used for system files when disabling sparse feature

Jan Kara jack at suse.cz
Mon Oct 19 00:01:39 PDT 2009


System files (except for root directory) are not accounted in quota. So we
should not add the space used to fill holes in them when disabling sparse
feature.

Signed-off-by: Jan Kara <jack at suse.cz>
---
 tunefs.ocfs2/feature_sparse_files.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/tunefs.ocfs2/feature_sparse_files.c b/tunefs.ocfs2/feature_sparse_files.c
index 5ae3ff5..829be64 100644
--- a/tunefs.ocfs2/feature_sparse_files.c
+++ b/tunefs.ocfs2/feature_sparse_files.c
@@ -490,7 +490,9 @@ static errcode_t fill_sparse_files(ocfs2_filesys *fs,
 			if (ret)
 				break;
 		}
-		if (di->i_clusters != file->old_clusters) {
+		if (di->i_clusters != file->old_clusters &&
+		    (!(di->i_flags & OCFS2_SYSTEM_FL) ||
+		    file->blkno == super->s_root_blkno)) {
 			long long change;
 
 			if (di->i_clusters > file->old_clusters) {
-- 
1.6.0.2




More information about the Ocfs2-tools-devel mailing list