Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751123AbWBLSRp (ORCPT ); Sun, 12 Feb 2006 13:17:45 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751130AbWBLSRp (ORCPT ); Sun, 12 Feb 2006 13:17:45 -0500 Received: from pne-smtpout1-sn1.fre.skanova.net ([81.228.11.98]:44781 "EHLO pne-smtpout1-sn1.fre.skanova.net") by vger.kernel.org with ESMTP id S1751123AbWBLSRp (ORCPT ); Sun, 12 Feb 2006 13:17:45 -0500 To: linux-kernel@vger.kernel.org Cc: Phillip Susi , bfennema@falcon.csc.calpoly.edu, Christoph Hellwig , Al Viro , Andrew Morton Subject: [RFC][PATCH] UDF filesystem uid fix From: Peter Osterlund Date: 12 Feb 2006 19:17:38 +0100 Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1612 Lines: 43 Hi, I would appreciate if someone with file system knowledge could review this patch from Phillip Susi. From: Phillip Susi The UDF filesystem refused to update the file's uid and gid on the disk if the in memory inode's id matched the values in the uid= and gid= mount options. This was causing the owner to change from the desktop user to root when the volume was ejected and remounted. I changed this so that if the inode's id matches the mount option, it writes a -1 to disk, because when the filesystem reads a -1 from disk, it uses the mount option for the in memory inode. This allows you to use the uid/gid mount options in the way you would expect. --- fs/udf/inode.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/fs/udf/inode.c b/fs/udf/inode.c index 395e582..f892948 100644 --- a/fs/udf/inode.c +++ b/fs/udf/inode.c @@ -1337,9 +1337,13 @@ udf_update_inode(struct inode *inode, in if (inode->i_uid != UDF_SB(inode->i_sb)->s_uid) fe->uid = cpu_to_le32(inode->i_uid); + else + fe->uid = cpu_to_le32(-1); if (inode->i_gid != UDF_SB(inode->i_sb)->s_gid) fe->gid = cpu_to_le32(inode->i_gid); + else + fe->gid = cpu_to_le32(-1); udfperms = ((inode->i_mode & S_IRWXO) ) | ((inode->i_mode & S_IRWXG) << 2) | -- Peter Osterlund - petero2@telia.com http://web.telia.com/~u89404340 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/