* [PATCH 1/2] e2fsck: handle symlink properly with inline data
@ 2014-06-02 11:40 Zheng Liu
2014-06-02 11:40 ` [PATCH 2/2] debugfs: do not display fast symlink " Zheng Liu
2014-06-02 14:58 ` [PATCH 1/2] e2fsck: handle symlink properly " Theodore Ts'o
0 siblings, 2 replies; 4+ messages in thread
From: Zheng Liu @ 2014-06-02 11:40 UTC (permalink / raw)
To: linux-ext4
Cc: Ian Nartowicz, Tao Ma, Darrick J. Wong, Andreas Dilger,
Theodore Ts'o, Zheng Liu
From: Zheng Liu <wenqing.lz@taobao.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@nartowicz.co.uk>
Cc: Tao Ma <tm@tao.ma>
Cc: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: Andreas Dilger <adilger.kernel@dilger.ca>
Cc: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Zheng Liu <wenqing.lz@taobao.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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] debugfs: do not display fast symlink with inline data
2014-06-02 11:40 [PATCH 1/2] e2fsck: handle symlink properly with inline data Zheng Liu
@ 2014-06-02 11:40 ` Zheng Liu
2014-06-02 14:58 ` Theodore Ts'o
2014-06-02 14:58 ` [PATCH 1/2] e2fsck: handle symlink properly " Theodore Ts'o
1 sibling, 1 reply; 4+ messages in thread
From: Zheng Liu @ 2014-06-02 11:40 UTC (permalink / raw)
To: linux-ext4
Cc: Ian Nartowicz, Tao Ma, Darrick J. Wong, Andreas Dilger,
Theodore Ts'o, Zheng Liu
From: Zheng Liu <wenqing.lz@taobao.com>
After enabling symlink with inline data, stat command in debugfs will
think an inode is a fast symlink. This patch fixes this issue.
Cc: Ian Nartowicz <claws@nartowicz.co.uk>
Cc: Tao Ma <tm@tao.ma>
Cc: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: Andreas Dilger <adilger.kernel@dilger.ca>
Cc: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>
---
debugfs/debugfs.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/debugfs/debugfs.c b/debugfs/debugfs.c
index 23a7ca3..2147ffa 100644
--- a/debugfs/debugfs.c
+++ b/debugfs/debugfs.c
@@ -784,7 +784,9 @@ void internal_dump_inode(FILE *out, const char *prefix,
fprintf(out, "Inode checksum: 0x%08x\n", crc);
}
- if (LINUX_S_ISLNK(inode->i_mode) && ext2fs_inode_data_blocks(current_fs,inode) == 0)
+ if (LINUX_S_ISLNK(inode->i_mode) &&
+ ext2fs_inode_data_blocks(current_fs,inode) == 0 &&
+ !(inode->i_flags & EXT4_INLINE_DATA_FL))
fprintf(out, "%sFast_link_dest: %.*s\n", prefix,
(int) inode->i_size, (char *)inode->i_block);
else if (LINUX_S_ISBLK(inode->i_mode) || LINUX_S_ISCHR(inode->i_mode)) {
--
1.7.9.7
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] e2fsck: handle symlink properly with inline data
2014-06-02 11:40 [PATCH 1/2] e2fsck: handle symlink properly with inline data Zheng Liu
2014-06-02 11:40 ` [PATCH 2/2] debugfs: do not display fast symlink " Zheng Liu
@ 2014-06-02 14:58 ` Theodore Ts'o
1 sibling, 0 replies; 4+ messages in thread
From: Theodore Ts'o @ 2014-06-02 14:58 UTC (permalink / raw)
To: Zheng Liu
Cc: linux-ext4, Ian Nartowicz, Tao Ma, Darrick J. Wong,
Andreas Dilger, Zheng Liu
On Mon, Jun 02, 2014 at 07:40:40PM +0800, Zheng Liu wrote:
> From: Zheng Liu <wenqing.lz@taobao.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.
Applied, thanks.
- Ted
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 2/2] debugfs: do not display fast symlink with inline data
2014-06-02 11:40 ` [PATCH 2/2] debugfs: do not display fast symlink " Zheng Liu
@ 2014-06-02 14:58 ` Theodore Ts'o
0 siblings, 0 replies; 4+ messages in thread
From: Theodore Ts'o @ 2014-06-02 14:58 UTC (permalink / raw)
To: Zheng Liu
Cc: linux-ext4, Ian Nartowicz, Tao Ma, Darrick J. Wong,
Andreas Dilger, Zheng Liu
On Mon, Jun 02, 2014 at 07:40:41PM +0800, Zheng Liu wrote:
> From: Zheng Liu <wenqing.lz@taobao.com>
>
> After enabling symlink with inline data, stat command in debugfs will
> think an inode is a fast symlink. This patch fixes this issue.
Applied, thanks.
- Ted
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-06-02 14:58 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-02 11:40 [PATCH 1/2] e2fsck: handle symlink properly with inline data Zheng Liu
2014-06-02 11:40 ` [PATCH 2/2] debugfs: do not display fast symlink " Zheng Liu
2014-06-02 14:58 ` Theodore Ts'o
2014-06-02 14:58 ` [PATCH 1/2] e2fsck: handle symlink properly " Theodore Ts'o
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).