linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* fix the ext4_read_inline_dir return value
@ 2013-09-17 15:08 Boxi Liu
  2013-09-17 16:29 ` Jan Kara
  0 siblings, 1 reply; 9+ messages in thread
From: Boxi Liu @ 2013-09-17 15:08 UTC (permalink / raw)
  To: linux-ext4@vger.kernel.org, Theodore Tso, Robin Dong, tm@tao.ma,
	lewis.liulei, pamirs

hi,
there may be a bug in ext4_read_inline_dir() function with inline_data feature.
when I recursion call a sys_old_readdir to read a direntry's
sub_dentry,I find that the ext4_read_inline_dir return the len of the
inline_data ,but in the no inline_data case,it will return 0.It is
inconsistent.
So I try to make a patch to fix it.

diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c
index d9ecbf1..3ea39cd 100644
--- a/fs/ext4/inline.c
+++ b/fs/ext4/inline.c
@@ -1441,7 +1441,7 @@ int ext4_read_inline_dir(struct file *file,
  up_read(&EXT4_I(inode)->xattr_sem);
  if (ret < 0)
  goto out;

^ permalink raw reply related	[flat|nested] 9+ messages in thread
* fix the ext4_read_inline_dir return value
@ 2013-10-21 16:33 Boxi Liu
  2013-10-21 17:35 ` jon ernst
  2013-10-22  2:10 ` Tao Ma
  0 siblings, 2 replies; 9+ messages in thread
From: Boxi Liu @ 2013-10-21 16:33 UTC (permalink / raw)
  To: Theodore Tso
  Cc: lewis.liulei, linux-ext4@vger.kernel.org, Robin Dong, tm@tao.ma

[-- Attachment #1: Type: text/plain, Size: 340 bytes --]

hi,
there may be a bug in ext4_read_inline_dir() function with inline_data feature.
when I recursion call a sys_old_readdir to read a direntry's
sub_dentry,I find that the ext4_read_inline_dir return the len of the
inline_data ,but in the no inline_data case,it will return 0.It is
inconsistent.
So I try to make a patch to fix it.

[-- Attachment #2: 0001-ext4-fix-the-ext4_read_inline_dir-return-value.patch --]
[-- Type: application/octet-stream, Size: 898 bytes --]

From 0ece067fe8a60566a9c3f636421e280e17277307 Mon Sep 17 00:00:00 2001
From: BoxiLiu <lewis.liulei@huawei.com>
Date: Wed, 18 Sep 2013 01:06:40 +0800
Subject: [PATCH] 	ext4: fix the ext4_read_inline_dir return value

	In ext4_read_inlne_dir,the return value is the return
	of ext4_read_inline_data len.But in no inline_data case,
	the return value is 0,it's inconsistent.So fix the return
	value of ext4_read_inline_dir.

Signed-off-by: BoxiLiu <lewis.liulei@huawei.com>
---
 fs/ext4/inline.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c
index d9ecbf1..c3efb65 100644
--- a/fs/ext4/inline.c
+++ b/fs/ext4/inline.c
@@ -1442,6 +1442,7 @@ int ext4_read_inline_dir(struct file *file,
 	if (ret < 0)
 		goto out;
 
+	ret = 0;
 	sb = inode->i_sb;
 	parent_ino = le32_to_cpu(((struct ext4_dir_entry_2 *)dir_buf)->inode);
 	offset = ctx->pos;
-- 
1.8.1.msysgit.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2013-10-31  2:35 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-17 15:08 fix the ext4_read_inline_dir return value Boxi Liu
2013-09-17 16:29 ` Jan Kara
2013-09-17 17:30   ` Boxi Liu
2013-09-17 17:38     ` Jan Kara
  -- strict thread matches above, loose matches on Subject: below --
2013-10-21 16:33 Boxi Liu
2013-10-21 17:35 ` jon ernst
2013-10-22  2:10 ` Tao Ma
2013-10-30 12:13   ` Theodore Ts'o
2013-10-31  2:34     ` Tao Ma

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).