All of lore.kernel.org
 help / color / mirror / Atom feed
From: Theodore Ts'o <tytso@mit.edu>
To: Chen Gang <gang.chen@asianux.com>
Cc: jack@suse.cz, akpm@linux-foundation.org, linux-ext4@vger.kernel.org
Subject: Re: [PATCH] fs/ext3: use kzalloc instead of kmalloc
Date: Tue, 25 Dec 2012 23:45:32 -0500	[thread overview]
Message-ID: <20121226044532.GB16669@thunk.org> (raw)
In-Reply-To: <50DA6BC7.1000804@asianux.com>

On Wed, Dec 26, 2012 at 11:15:19AM +0800, Chen Gang wrote:
> 
>   checking the ext3_acl_size, it does not like what you said above.
>   but we can say, the design for ext3_acl_size is really not quit well.
>     (maybe can cause issue).

Ah, I see.  What's there is OK, but it's not at all obvious that it's
OK.  A valid acl must have a very specific order of tags, as enforced
by posix_acl_valid() in fs/posix_acl.c:

ACL_USER_OBJ ACL_USER*[1] ACL_GROUP_OBJ ACL_GROUP*[1] ACL_MASK[2] ACL_OTHER 

[1] Where * is the regexp sense of "0 or more times"
[2] Only if there is at least one ACL_USER or ACL_GROUP tag; otherwise
	skip ACL_MASK.

Hence, a valid acl can have at most 4 short acl entry types
(ACL_USER_OBJ, ACL_GROUP, ACL_MASK, and ACL_OTHER), and if there is
less than 4 acl entries, they must all be short acl types.

All I can say is, this is a horrible way of coding things, and I wish
this was documented explicitly somewhere either in fs/posix_acl.c or
in include/linux/posix_acl.h.  Yuck, yuck, yuck....

						- Ted

  reply	other threads:[~2012-12-26  4:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-24  5:28 [PATCH] fs/ext3: use kzalloc instead of kmalloc Chen Gang
2012-12-25 18:48 ` Theodore Ts'o
2012-12-26  3:15   ` Chen Gang
2012-12-26  4:45     ` Theodore Ts'o [this message]
2012-12-26  5:08       ` Chen Gang
2012-12-26  5:34         ` Chen Gang

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=20121226044532.GB16669@thunk.org \
    --to=tytso@mit.edu \
    --cc=akpm@linux-foundation.org \
    --cc=gang.chen@asianux.com \
    --cc=jack@suse.cz \
    --cc=linux-ext4@vger.kernel.org \
    /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.