public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC][PATCH] UDF filesystem uid fix
@ 2006-02-12 18:17 Peter Osterlund
  2006-02-13  9:49 ` Pekka Enberg
  0 siblings, 1 reply; 12+ messages in thread
From: Peter Osterlund @ 2006-02-12 18:17 UTC (permalink / raw)
  To: linux-kernel
  Cc: Phillip Susi, bfennema, Christoph Hellwig, Al Viro, Andrew Morton

Hi,

I would appreciate if someone with file system knowledge could review
this patch from Phillip Susi.


From: Phillip Susi <psusi@cfl.rr.com>

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

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2006-03-04 23:20 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-12 18:17 [RFC][PATCH] UDF filesystem uid fix Peter Osterlund
2006-02-13  9:49 ` Pekka Enberg
2006-02-13 16:51   ` Phillip Susi
2006-02-14  7:28     ` Pekka J Enberg
2006-02-14 11:36       ` Sergey Vlasov
2006-02-14 15:54       ` Phillip Susi
2006-02-15  7:31         ` Pekka Enberg
2006-02-15 15:55           ` Phillip Susi
2006-02-15 17:31             ` Pekka Enberg
2006-02-15 18:48               ` Phillip Susi
2006-02-15 20:28                 ` Pekka Enberg
2006-03-04 23:19                 ` Phillip Susi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox