From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andi Kleen Subject: Re: Possible coding issue in udf?? Date: Sun, 15 May 2011 08:14:02 -0700 Message-ID: References: <367853.39582.qm@web130121.mail.mud.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org To: Alex Davis Return-path: In-Reply-To: <367853.39582.qm@web130121.mail.mud.yahoo.com> (Alex Davis's message of "Fri, 13 May 2011 19:57:20 -0700 (PDT)") Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org Alex Davis 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); > > The S_I.. constants are all defined in include/linux/stat.h as 3-bit values. > > I will send a patch if needed. I would suggest you test it first. Put in a UDF disk that triggers this case (verify with a printk). Check in ls -l if the permissions are correct or wrong. -Andi -- ak@linux.intel.com -- Speaking for myself only