diff options
Diffstat (limited to 'fs/udf/inode.c')
-rw-r--r-- | fs/udf/inode.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/fs/udf/inode.c b/fs/udf/inode.c index 395e582ee542..d04cff2273b6 100644 --- a/fs/udf/inode.c +++ b/fs/udf/inode.c | |||
@@ -1045,10 +1045,14 @@ static void udf_fill_inode(struct inode *inode, struct buffer_head *bh) | |||
1045 | } | 1045 | } |
1046 | 1046 | ||
1047 | inode->i_uid = le32_to_cpu(fe->uid); | 1047 | inode->i_uid = le32_to_cpu(fe->uid); |
1048 | if ( inode->i_uid == -1 ) inode->i_uid = UDF_SB(inode->i_sb)->s_uid; | 1048 | if (inode->i_uid == -1 || UDF_QUERY_FLAG(inode->i_sb, |
1049 | UDF_FLAG_UID_IGNORE)) | ||
1050 | inode->i_uid = UDF_SB(inode->i_sb)->s_uid; | ||
1049 | 1051 | ||
1050 | inode->i_gid = le32_to_cpu(fe->gid); | 1052 | inode->i_gid = le32_to_cpu(fe->gid); |
1051 | if ( inode->i_gid == -1 ) inode->i_gid = UDF_SB(inode->i_sb)->s_gid; | 1053 | if (inode->i_gid == -1 || UDF_QUERY_FLAG(inode->i_sb, |
1054 | UDF_FLAG_GID_IGNORE)) | ||
1055 | inode->i_gid = UDF_SB(inode->i_sb)->s_gid; | ||
1052 | 1056 | ||
1053 | inode->i_nlink = le16_to_cpu(fe->fileLinkCount); | 1057 | inode->i_nlink = le16_to_cpu(fe->fileLinkCount); |
1054 | if (!inode->i_nlink) | 1058 | if (!inode->i_nlink) |
@@ -1335,10 +1339,14 @@ udf_update_inode(struct inode *inode, int do_sync) | |||
1335 | return err; | 1339 | return err; |
1336 | } | 1340 | } |
1337 | 1341 | ||
1338 | if (inode->i_uid != UDF_SB(inode->i_sb)->s_uid) | 1342 | if (UDF_QUERY_FLAG(inode->i_sb, UDF_FLAG_UID_FORGET)) |
1343 | fe->uid = cpu_to_le32(-1); | ||
1344 | else if (inode->i_uid != UDF_SB(inode->i_sb)->s_uid) | ||
1339 | fe->uid = cpu_to_le32(inode->i_uid); | 1345 | fe->uid = cpu_to_le32(inode->i_uid); |
1340 | 1346 | ||
1341 | if (inode->i_gid != UDF_SB(inode->i_sb)->s_gid) | 1347 | if (UDF_QUERY_FLAG(inode->i_sb, UDF_FLAG_GID_FORGET)) |
1348 | fe->gid = cpu_to_le32(-1); | ||
1349 | else if (inode->i_gid != UDF_SB(inode->i_sb)->s_gid) | ||
1342 | fe->gid = cpu_to_le32(inode->i_gid); | 1350 | fe->gid = cpu_to_le32(inode->i_gid); |
1343 | 1351 | ||
1344 | udfperms = ((inode->i_mode & S_IRWXO) ) | | 1352 | udfperms = ((inode->i_mode & S_IRWXO) ) | |