UDF filesystem uid fix 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 | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/fs/udf/inode.c b/fs/udf/inode.c index 395e582..84b70b6 100644 --- a/fs/udf/inode.c +++ b/fs/udf/inode.c @@ -1337,9 +1337,11 @@ 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) |