Tao Ma
2009-May-03 21:18 UTC
[Ocfs2-devel] [PATCH] ocfs2: Don't print error when listing too many xattrs.
Currently, when listing xattrs, kernel define XATTR_LIST_MAX as 65536
in include/linux/limits.h, so it can't handle too many xattrs.
But with ocfs2 xattr tree, we actually have no limit for the number.
And it will pollute the message with something like this when listing.
(27738,0):ocfs2_iterate_xattr_buckets:3158 ERROR: status = -34
(27738,0):ocfs2_xattr_tree_list_index_block:3264 ERROR: status = -34
So don't print "ERROR" message as this is not an ocfs2 error.
Signed-off-by: Tao Ma <tao.ma at oracle.com>
---
fs/ocfs2/xattr.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c
index 1563101..ba320e2 100644
--- a/fs/ocfs2/xattr.c
+++ b/fs/ocfs2/xattr.c
@@ -3154,7 +3154,7 @@ static int ocfs2_iterate_xattr_buckets(struct inode
*inode,
le32_to_cpu(bucket_xh(bucket)->xh_entries[0].xe_name_hash));
if (func) {
ret = func(inode, bucket, para);
- if (ret)
+ if (ret && ret != -ERANGE)
mlog_errno(ret);
/* Fall through to bucket_relse() */
}
@@ -3261,7 +3261,8 @@ static int ocfs2_xattr_tree_list_index_block(struct inode
*inode,
ocfs2_list_xattr_bucket,
&xl);
if (ret) {
- mlog_errno(ret);
+ if (ret != -ERANGE)
+ mlog_errno(ret);
goto out;
}
--
1.5.5
Joel Becker
2009-May-04 17:06 UTC
[Ocfs2-devel] [PATCH] ocfs2: Don't print error when listing too many xattrs.
On Mon, May 04, 2009 at 05:18:09AM +0800, Tao Ma wrote:> Currently, when listing xattrs, kernel define XATTR_LIST_MAX as 65536 > in include/linux/limits.h, so it can't handle too many xattrs. > > But with ocfs2 xattr tree, we actually have no limit for the number. > And it will pollute the message with something like this when listing. > (27738,0):ocfs2_iterate_xattr_buckets:3158 ERROR: status = -34 > (27738,0):ocfs2_xattr_tree_list_index_block:3264 ERROR: status = -34 > > So don't print "ERROR" message as this is not an ocfs2 error.Hmm, but this will stop iteration of the xattrs right where we hit the large one. I don't think that's correct. At the very least, we should go on listing with the following xattrs. Now, the xattr with a too-long name - should we skip it, or should we list a truncated name? That I'm not sure of. Joel -- print STDOUT q Just another Perl hacker, unless $spring - Larry Wall Joel Becker Principal Software Developer Oracle E-mail: joel.becker at oracle.com Phone: (650) 506-8127
Joel Becker
2009-May-05 23:11 UTC
[Ocfs2-devel] [PATCH] ocfs2: Don't print error when listing too many xattrs.
On Mon, May 04, 2009 at 05:18:09AM +0800, Tao Ma wrote:> Currently, when listing xattrs, kernel define XATTR_LIST_MAX as 65536 > in include/linux/limits.h, so it can't handle too many xattrs. > > But with ocfs2 xattr tree, we actually have no limit for the number. > And it will pollute the message with something like this when listing. > (27738,0):ocfs2_iterate_xattr_buckets:3158 ERROR: status = -34 > (27738,0):ocfs2_xattr_tree_list_index_block:3264 ERROR: status = -34 > > So don't print "ERROR" message as this is not an ocfs2 error. > > Signed-off-by: Tao Ma <tao.ma at oracle.com>This is in 'fixes' now. Joel -- "Egotist: a person more interested in himself than in me." - Ambrose Bierce Joel Becker Principal Software Developer Oracle E-mail: joel.becker at oracle.com Phone: (650) 506-8127