From: Tao Ma <tao.ma@oracle.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH] ocfs2: Don't print error when listing too many xattrs.
Date: Tue, 05 May 2009 09:40:31 +0800 [thread overview]
Message-ID: <49FF990F.4020308@oracle.com> (raw)
In-Reply-To: <20090504170624.GC31249@mail.oracle.com>
Hi Joel,
Joel Becker wrote:
> 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.
I think we should stop at where we are, return errors and let the user
space handle this.
Just give you an example.
1. for((i=0;i<20000;i++))do setfattr -n "user.name$i" -v "aaaaa"
/mnt/ocfs2/a;done
This will create a very long name list.
2. getfattr /mnt/ocfs2/a
/mnt/ocfs2/a: Argument list too long
So you see it says clearly that the name list is too long.
and the same goes for listxattr(2).
If the size of the list buffer is too small to hold the result, errno is
set to ERANGE.
But if you go ahead and don't return errors. we will get a name list of
about ~5000 xattrs and no error is returned. So the user may wonder why
I set 20000 xattrs, but only get 5000 xattrs and look@this as a bug.
Regards,
Tao
next prev parent reply other threads:[~2009-05-05 1:40 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-03 21:18 [Ocfs2-devel] [PATCH] ocfs2: Don't print error when listing too many xattrs Tao Ma
2009-05-04 17:06 ` Joel Becker
2009-05-05 1:40 ` Tao Ma [this message]
2009-05-05 7:18 ` Joel Becker
2009-05-05 7:39 ` Tao Ma
2009-05-05 23:11 ` Joel Becker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=49FF990F.4020308@oracle.com \
--to=tao.ma@oracle.com \
--cc=ocfs2-devel@oss.oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.