Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 229146
b: refs/heads/master
c: c03cad2
h: refs/heads/master
v: v3
  • Loading branch information
Jan Kara committed Jan 6, 2011
1 parent 3334442 commit 2d29e72
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 949f4a7c08bc4a050eae7aeeac3e6d019d1feafb
refs/heads/master: c03cad241af63445b751781a09faf08b3a5b77c1
16 changes: 9 additions & 7 deletions trunk/fs/udf/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1201,6 +1201,7 @@ static void udf_fill_inode(struct inode *inode, struct buffer_head *bh)
return;
}

read_lock(&sbi->s_cred_lock);
inode->i_uid = le32_to_cpu(fe->uid);
if (inode->i_uid == -1 ||
UDF_QUERY_FLAG(inode->i_sb, UDF_FLAG_UID_IGNORE) ||
Expand All @@ -1213,13 +1214,6 @@ static void udf_fill_inode(struct inode *inode, struct buffer_head *bh)
UDF_QUERY_FLAG(inode->i_sb, UDF_FLAG_GID_SET))
inode->i_gid = UDF_SB(inode->i_sb)->s_gid;

inode->i_nlink = le16_to_cpu(fe->fileLinkCount);
if (!inode->i_nlink)
inode->i_nlink = 1;

inode->i_size = le64_to_cpu(fe->informationLength);
iinfo->i_lenExtents = inode->i_size;

if (fe->icbTag.fileType != ICBTAG_FILE_TYPE_DIRECTORY &&
sbi->s_fmode != UDF_INVALID_MODE)
inode->i_mode = sbi->s_fmode;
Expand All @@ -1229,6 +1223,14 @@ static void udf_fill_inode(struct inode *inode, struct buffer_head *bh)
else
inode->i_mode = udf_convert_permissions(fe);
inode->i_mode &= ~sbi->s_umask;
read_unlock(&sbi->s_cred_lock);

inode->i_nlink = le16_to_cpu(fe->fileLinkCount);
if (!inode->i_nlink)
inode->i_nlink = 1;

inode->i_size = le64_to_cpu(fe->informationLength);
iinfo->i_lenExtents = inode->i_size;

if (iinfo->i_efe == 0) {
inode->i_blocks = le64_to_cpu(fe->logicalBlocksRecorded) <<
Expand Down
3 changes: 3 additions & 0 deletions trunk/fs/udf/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -568,12 +568,14 @@ static int udf_remount_fs(struct super_block *sb, int *flags, char *options)
return -EINVAL;

lock_kernel();
write_lock(&sbi->s_cred_lock);
sbi->s_flags = uopt.flags;
sbi->s_uid = uopt.uid;
sbi->s_gid = uopt.gid;
sbi->s_umask = uopt.umask;
sbi->s_fmode = uopt.fmode;
sbi->s_dmode = uopt.dmode;
write_unlock(&sbi->s_cred_lock);

if (sbi->s_lvid_bh) {
int write_rev = le16_to_cpu(udf_sb_lvidiu(sbi)->minUDFWriteRev);
Expand Down Expand Up @@ -1960,6 +1962,7 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent)
sbi->s_fmode = uopt.fmode;
sbi->s_dmode = uopt.dmode;
sbi->s_nls_map = uopt.nls_map;
rwlock_init(&sbi->s_cred_lock);

if (uopt.session == 0xFFFFFFFF)
sbi->s_session = udf_get_last_session(sb);
Expand Down
2 changes: 2 additions & 0 deletions trunk/fs/udf/udf_sb.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ struct udf_sb_info {
uid_t s_uid;
mode_t s_fmode;
mode_t s_dmode;
/* Lock protecting consistency of above permission settings */
rwlock_t s_cred_lock;

/* Root Info */
struct timespec s_record_time;
Expand Down

0 comments on commit 2d29e72

Please sign in to comment.