From: Alex Davis <alex14641@yahoo.com>
To: Andreas Schwab <schwab@linux-m68k.org>
Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: Possible coding issue in udf??
Date: Sun, 15 May 2011 11:04:27 -0700 (PDT) [thread overview]
Message-ID: <177649.65029.qm@web130106.mail.mud.yahoo.com> (raw)
In-Reply-To: <m2pqnjevjc.fsf@igel.home>
I get it now.
Thanks.
I code, therefore I am
--- On Sun, 5/15/11, Andreas Schwab <schwab@linux-m68k.org> wrote:
> From: Andreas Schwab <schwab@linux-m68k.org>
> Subject: Re: Possible coding issue in udf??
> To: "Alex Davis" <alex14641@yahoo.com>
> Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org
> Date: Sunday, May 15, 2011, 1:13 PM
> Alex Davis <alex14641@yahoo.com>
> writes:
>
> > In fs/udf/inode.c, line 1455, linux 2.6.35, there is
> the following code:
> >
> > udfperms = ((inode->i_mode &
> S_IRWXO)) |
> >
> ((inode->i_mode & S_IRWXG) <<
> 2) |
> >
> ((inode->i_mode & S_IRWXU) <<
> 4);
> >
> > Shouldn't we be shifting by 3 bits? i.e:
> > udfperms = ((inode->i_mode &
> S_IRWXO)) |
> >
> ((inode->i_mode & S_IRWXG) <<
> 3) |
> >
> ((inode->i_mode & S_IRWXU) <<
> 6);
>
> udfperms contains three bit fields of 5 bits each, of which
> 3 bits are
> each filled from one of the three RWX parts of i_mode, and
> 2 bits
> (DELETE and CHATTR) are added later. Thus each of the
> three bit fields
> are expanded from 3 to 5 bits, so that the second one needs
> to be
> shifted by 2 and the third one by 4.
>
> Andreas.
>
> --
> Andreas Schwab, schwab@linux-m68k.org
> GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3
> 44D5 214B 8276 4ED5
> "And now for something completely different."
>
prev parent reply other threads:[~2011-05-15 18:09 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-14 2:57 Possible coding issue in udf?? Alex Davis
2011-05-15 15:14 ` Andi Kleen
2011-05-15 16:29 ` Eric Dumazet
2011-05-15 16:32 ` Andreas Dilger
2011-05-15 17:15 ` Andreas Schwab
2011-05-15 17:13 ` Andreas Schwab
2011-05-15 18:04 ` Alex Davis [this message]
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=177649.65029.qm@web130106.mail.mud.yahoo.com \
--to=alex14641@yahoo.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=schwab@linux-m68k.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 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).