public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Phillip Susi <psusi@cfl.rr.com>
To: linux-kernel@vger.kernel.org
Subject: [PATCH] udf: fix uid/gid options and add uid/gid=ignore and forget options
Date: Sun, 19 Mar 2006 21:32:15 -0500	[thread overview]
Message-ID: <441E142F.2030305@cfl.rr.com> (raw)

This patch corrects the incorrect patch previously applied in
commit 4d6660eb3665f22d16aff466eb9d45df6102b254.  I had posted
the correction as a reply on lkml, but it seems that the earlier
and incorrect patch got merged into Linus's tree.  This patch
also adds documentation for the changes made last time.

---

Documentation/filesystems/udf.txt |   14 ++++++++++++++
fs/udf/inode.c                    |    6 ++----
2 files changed, 16 insertions(+), 4 deletions(-)

83a730fb2e864dae308008d83c5d804afc539f08
diff --git a/Documentation/filesystems/udf.txt b/Documentation/filesystems/udf.txt
index e5213bc..85ff288 100644
--- a/Documentation/filesystems/udf.txt
+++ b/Documentation/filesystems/udf.txt
@@ -26,6 +26,20 @@ The following mount options are supporte
	nostrict	Unset strict conformance
	iocharset=	Set the NLS character set

+The uid= and gid= options need a bit more explaining.  They will accept a
+decimal numeric value which will be used as the default ID for that mount.
+They will also accept the string "ignore" and "forget".  For files on the disk
+that are owned by nobody ( -1 ), they will instead look as if they are owned
+by the default ID.  The ignore option causes the default ID to override all
+IDs on the disk, not just -1.  The forget option causes all IDs to be written
+to disk as -1, so when the media is later remounted, they will appear to be
+owned by whatever default ID it is mounted with at that time.  
+
+For typical desktop use of removable media, you should set the ID to that
+of the interactively logged on user, and also specify both the forget and
+ignore options.  This way the interactive user will always see the files
+on the disk as belonging to him.  
+
The remaining are for debugging and disaster recovery:

	novrs		Skip volume sequence recognition 
diff --git a/fs/udf/inode.c b/fs/udf/inode.c
index d04cff2..81e0e84 100644
--- a/fs/udf/inode.c
+++ b/fs/udf/inode.c
@@ -1341,13 +1341,11 @@ udf_update_inode(struct inode *inode, in

	if (UDF_QUERY_FLAG(inode->i_sb, UDF_FLAG_UID_FORGET))
		fe->uid = cpu_to_le32(-1);
-	else 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(inode->i_uid);

	if (UDF_QUERY_FLAG(inode->i_sb, UDF_FLAG_GID_FORGET))
		fe->gid = cpu_to_le32(-1);
-	else 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(inode->i_gid);

	udfperms =	((inode->i_mode & S_IRWXO)     ) |
			((inode->i_mode & S_IRWXG) << 2) |
-- 
1.1.3


             reply	other threads:[~2006-03-20  2:32 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-20  2:32 Phillip Susi [this message]
2006-03-20  4:04 ` [PATCH] udf: fix uid/gid options and add uid/gid=ignore and forget options Andrew Morton
2006-03-20 16:25   ` Phillip Susi
  -- strict thread matches above, loose matches on Subject: below --
2006-03-04 19:32 Phillip Susi
2006-03-05 19:22 ` Pekka Enberg
2006-03-06  1:10   ` Phillip Susi
2006-03-06  7:31     ` Pekka J Enberg
2006-03-07  3:23       ` Phillip Susi
2006-03-07  7:24         ` Pekka J Enberg
2006-03-07 15:49           ` Phillip Susi
2006-03-07 16:50             ` Sergey Vlasov

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=441E142F.2030305@cfl.rr.com \
    --to=psusi@cfl.rr.com \
    --cc=linux-kernel@vger.kernel.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