diff options
-rw-r--r-- | Documentation/filesystems/udf.txt | 14 | ||||
-rw-r--r-- | fs/udf/inode.c | 6 |
2 files changed, 16 insertions, 4 deletions
diff --git a/Documentation/filesystems/udf.txt b/Documentation/filesystems/udf.txt index e5213bc301f7..511b4230c053 100644 --- a/Documentation/filesystems/udf.txt +++ b/Documentation/filesystems/udf.txt | |||
@@ -26,6 +26,20 @@ The following mount options are supported: | |||
26 | nostrict Unset strict conformance | 26 | nostrict Unset strict conformance |
27 | iocharset= Set the NLS character set | 27 | iocharset= Set the NLS character set |
28 | 28 | ||
29 | The uid= and gid= options need a bit more explaining. They will accept a | ||
30 | decimal numeric value which will be used as the default ID for that mount. | ||
31 | They will also accept the string "ignore" and "forget". For files on the disk | ||
32 | that are owned by nobody ( -1 ), they will instead look as if they are owned | ||
33 | by the default ID. The ignore option causes the default ID to override all | ||
34 | IDs on the disk, not just -1. The forget option causes all IDs to be written | ||
35 | to disk as -1, so when the media is later remounted, they will appear to be | ||
36 | owned by whatever default ID it is mounted with at that time. | ||
37 | |||
38 | For typical desktop use of removable media, you should set the ID to that | ||
39 | of the interactively logged on user, and also specify both the forget and | ||
40 | ignore options. This way the interactive user will always see the files | ||
41 | on the disk as belonging to him. | ||
42 | |||
29 | The remaining are for debugging and disaster recovery: | 43 | The remaining are for debugging and disaster recovery: |
30 | 44 | ||
31 | novrs Skip volume sequence recognition | 45 | novrs Skip volume sequence recognition |
diff --git a/fs/udf/inode.c b/fs/udf/inode.c index d04cff2273b6..81e0e8459af1 100644 --- a/fs/udf/inode.c +++ b/fs/udf/inode.c | |||
@@ -1341,13 +1341,11 @@ udf_update_inode(struct inode *inode, int do_sync) | |||
1341 | 1341 | ||
1342 | if (UDF_QUERY_FLAG(inode->i_sb, UDF_FLAG_UID_FORGET)) | 1342 | if (UDF_QUERY_FLAG(inode->i_sb, UDF_FLAG_UID_FORGET)) |
1343 | fe->uid = cpu_to_le32(-1); | 1343 | fe->uid = cpu_to_le32(-1); |
1344 | else if (inode->i_uid != UDF_SB(inode->i_sb)->s_uid) | 1344 | else fe->uid = cpu_to_le32(inode->i_uid); |
1345 | fe->uid = cpu_to_le32(inode->i_uid); | ||
1346 | 1345 | ||
1347 | if (UDF_QUERY_FLAG(inode->i_sb, UDF_FLAG_GID_FORGET)) | 1346 | if (UDF_QUERY_FLAG(inode->i_sb, UDF_FLAG_GID_FORGET)) |
1348 | fe->gid = cpu_to_le32(-1); | 1347 | fe->gid = cpu_to_le32(-1); |
1349 | else if (inode->i_gid != UDF_SB(inode->i_sb)->s_gid) | 1348 | else fe->gid = cpu_to_le32(inode->i_gid); |
1350 | fe->gid = cpu_to_le32(inode->i_gid); | ||
1351 | 1349 | ||
1352 | udfperms = ((inode->i_mode & S_IRWXO) ) | | 1350 | udfperms = ((inode->i_mode & S_IRWXO) ) | |
1353 | ((inode->i_mode & S_IRWXG) << 2) | | 1351 | ((inode->i_mode & S_IRWXG) << 2) | |