linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] libext2fs: do not print any error message from libext2fs
@ 2013-04-27 10:44 Zheng Liu
  2013-05-13 16:53 ` Zheng Liu
  2013-05-21  2:36 ` Theodore Ts'o
  0 siblings, 2 replies; 6+ messages in thread
From: Zheng Liu @ 2013-04-27 10:44 UTC (permalink / raw)
  To: linux-ext4; +Cc: Theodore Ts'o, Zheng Liu

From: Zheng Liu <wenqing.lz@taobao.com>

In libext2fs we don't print any error message form it except that OMIT_COM_ERR
is defined.  In lib/ext2fs/inline_data.c it doesn't obey this rule.  So fix it.
Meanwhile when we find an dir entry in inline data, we will print the message in
debugfs rather than in libext2fs.

Cc: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>
---
[This patch is against pu branch of e2fsprogs tree]

 debugfs/htree.c          | 5 ++++-
 lib/ext2fs/inline_data.c | 6 +++---
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/debugfs/htree.c b/debugfs/htree.c
index ca39b4b..e042fd7 100644
--- a/debugfs/htree.c
+++ b/debugfs/htree.c
@@ -388,8 +388,11 @@ void do_dirsearch(int argc, char *argv[])
 	pb.len = strlen(pb.search_name);
 
 	if (ext2fs_inode_has_inline_data(current_fs, inode)) {
-		ext2fs_inline_data_dirsearch(current_fs, inode,
+		errcode_t retval;
+		retval = ext2fs_inline_data_dirsearch(current_fs, inode,
 					     argv[2], strlen(argv[2]));
+		if (retval)
+			printf("Entry found at inline data\n");
 		goto out;
 	}
 
diff --git a/lib/ext2fs/inline_data.c b/lib/ext2fs/inline_data.c
index ea3736c..6d5cf52 100644
--- a/lib/ext2fs/inline_data.c
+++ b/lib/ext2fs/inline_data.c
@@ -134,16 +134,16 @@ static int do_search_dir(ext2_filsys fs, void *start, unsigned int size,
 		de = (struct ext2_dir_entry *)(start + offset);
 		errcode = ext2fs_get_rec_len(fs, de, &rec_len);
 		if (errcode) {
+#ifndef OMIT_COM_ERR
 			com_err("search_dir_inline_data", errcode,
 				"while getting rec_len for inline data");
+#endif
 			return errcode;
 		}
 		if (de->inode &&
 		    len == (de->name_len & 0xFF) &&
-		    strncmp(name, de->name, len) == 0) {
-			printf("Entry found at inline data\n");
+		    strncmp(name, de->name, len) == 0)
 			return 1;
-		}
 		offset += rec_len;
 	}
 	return 0;
-- 
1.7.12.rc2.18.g61b472e


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

end of thread, other threads:[~2013-05-21  3:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-27 10:44 [PATCH] libext2fs: do not print any error message from libext2fs Zheng Liu
2013-05-13 16:53 ` Zheng Liu
2013-05-21  2:36 ` Theodore Ts'o
2013-05-21  3:11   ` Zheng Liu
2013-05-21  3:26     ` My current version of the inline data patches Theodore Ts'o
2013-05-21  4:01       ` Zheng Liu

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