[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1401709241-27521-1-git-send-email-wenqing.lz@taobao.com>
Date: Mon, 2 Jun 2014 19:40:40 +0800
From: Zheng Liu <gnehzuil.liu@...il.com>
To: linux-ext4@...r.kernel.org
Cc: Ian Nartowicz <claws@...towicz.co.uk>, Tao Ma <tm@....ma>,
"Darrick J. Wong" <darrick.wong@...cle.com>,
Andreas Dilger <adilger.kernel@...ger.ca>,
"Theodore Ts'o" <tytso@....edu>, Zheng Liu <wenqing.lz@...bao.com>
Subject: [PATCH 1/2] e2fsck: handle symlink properly with inline data
From: Zheng Liu <wenqing.lz@...bao.com>
After fixing a bug on kernel side for handling symlink properly with
inline data, it will break the assumption in e2fsck because in original
patch set of inline data it doesn't support symlink with inline data
feature. This commit makes e2fsck handle symlink properly with inline
data.
After applied this patch, the inline data feature has ability to store
the symlink. We also need to add this ability for symlink commmand in
debugfs.
Cc: Ian Nartowicz <claws@...towicz.co.uk>
Cc: Tao Ma <tm@....ma>
Cc: "Darrick J. Wong" <darrick.wong@...cle.com>
Cc: Andreas Dilger <adilger.kernel@...ger.ca>
Cc: "Theodore Ts'o" <tytso@....edu>
Signed-off-by: Zheng Liu <wenqing.lz@...bao.com>
---
e2fsck/pass1.c | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/e2fsck/pass1.c b/e2fsck/pass1.c
index e1012c0..ba60029 100644
--- a/e2fsck/pass1.c
+++ b/e2fsck/pass1.c
@@ -177,8 +177,7 @@ int e2fsck_pass1_check_symlink(ext2_filsys fs, ext2_ino_t ino,
struct ext2fs_extent extent;
if ((inode->i_size_high || inode->i_size == 0) ||
- (inode->i_flags & EXT2_INDEX_FL) ||
- (inode->i_flags & EXT4_INLINE_DATA_FL))
+ (inode->i_flags & EXT2_INDEX_FL))
return 0;
if (inode->i_flags & EXT4_EXTENTS_FL) {
@@ -203,6 +202,17 @@ int e2fsck_pass1_check_symlink(ext2_filsys fs, ext2_ino_t ino,
return i;
}
+ if (inode->i_flags & EXT4_INLINE_DATA_FL) {
+ size_t inline_size;
+
+ if (ext2fs_inline_data_size(fs, ino, &inline_size))
+ return 0;
+ if (inode->i_size != inline_size)
+ return 0;
+
+ return 1;
+ }
+
blocks = ext2fs_inode_data_blocks2(fs, inode);
if (blocks) {
if ((inode->i_size >= fs->blocksize) ||
@@ -1189,7 +1199,9 @@ void e2fsck_pass1(e2fsck_t ctx)
block_buf)) {
check_immutable(ctx, &pctx);
ctx->fs_symlinks_count++;
- if (ext2fs_inode_data_blocks(fs, inode) == 0) {
+ if (inode->i_flags & EXT4_INLINE_DATA_FL) {
+ continue;
+ } else if (ext2fs_inode_data_blocks(fs, inode) == 0) {
ctx->fs_fast_symlinks_count++;
check_blocks(ctx, &pctx, block_buf);
continue;
--
1.7.9.7
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists