aboutsummaryrefslogtreecommitdiffstats
path: root/fs/omfs
diff options
context:
space:
mode:
Diffstat (limited to 'fs/omfs')
-rw-r--r--fs/omfs/file.c5
-rw-r--r--fs/omfs/inode.c8
-rw-r--r--fs/omfs/omfs.h4
3 files changed, 10 insertions, 7 deletions
diff --git a/fs/omfs/file.c b/fs/omfs/file.c
index 2c6d95257a4d..77e3cb2962b4 100644
--- a/fs/omfs/file.c
+++ b/fs/omfs/file.c
@@ -146,8 +146,7 @@ static int omfs_grow_extent(struct inode *inode, struct omfs_extent *oe,
146 be64_to_cpu(entry->e_blocks); 146 be64_to_cpu(entry->e_blocks);
147 147
148 if (omfs_allocate_block(inode->i_sb, new_block)) { 148 if (omfs_allocate_block(inode->i_sb, new_block)) {
149 entry->e_blocks = 149 be64_add_cpu(&entry->e_blocks, 1);
150 cpu_to_be64(be64_to_cpu(entry->e_blocks) + 1);
151 terminator->e_blocks = ~(cpu_to_be64( 150 terminator->e_blocks = ~(cpu_to_be64(
152 be64_to_cpu(~terminator->e_blocks) + 1)); 151 be64_to_cpu(~terminator->e_blocks) + 1));
153 goto out; 152 goto out;
@@ -177,7 +176,7 @@ static int omfs_grow_extent(struct inode *inode, struct omfs_extent *oe,
177 be64_to_cpu(~terminator->e_blocks) + (u64) new_count)); 176 be64_to_cpu(~terminator->e_blocks) + (u64) new_count));
178 177
179 /* write in new entry */ 178 /* write in new entry */
180 oe->e_extent_count = cpu_to_be32(1 + be32_to_cpu(oe->e_extent_count)); 179 be32_add_cpu(&oe->e_extent_count, 1);
181 180
182out: 181out:
183 *ret_block = new_block; 182 *ret_block = new_block;
diff --git a/fs/omfs/inode.c b/fs/omfs/inode.c
index e6213b3725d1..25d715c7c87a 100644
--- a/fs/omfs/inode.c
+++ b/fs/omfs/inode.c
@@ -391,12 +391,16 @@ static int parse_options(char *options, struct omfs_sb_info *sbi)
391 case Opt_uid: 391 case Opt_uid:
392 if (match_int(&args[0], &option)) 392 if (match_int(&args[0], &option))
393 return 0; 393 return 0;
394 sbi->s_uid = option; 394 sbi->s_uid = make_kuid(current_user_ns(), option);
395 if (!uid_valid(sbi->s_uid))
396 return 0;
395 break; 397 break;
396 case Opt_gid: 398 case Opt_gid:
397 if (match_int(&args[0], &option)) 399 if (match_int(&args[0], &option))
398 return 0; 400 return 0;
399 sbi->s_gid = option; 401 sbi->s_gid = make_kgid(current_user_ns(), option);
402 if (!gid_valid(sbi->s_gid))
403 return 0;
400 break; 404 break;
401 case Opt_umask: 405 case Opt_umask:
402 if (match_octal(&args[0], &option)) 406 if (match_octal(&args[0], &option))
diff --git a/fs/omfs/omfs.h b/fs/omfs/omfs.h
index 8941f12c6b01..f0f8bc75e609 100644
--- a/fs/omfs/omfs.h
+++ b/fs/omfs/omfs.h
@@ -19,8 +19,8 @@ struct omfs_sb_info {
19 unsigned long **s_imap; 19 unsigned long **s_imap;
20 int s_imap_size; 20 int s_imap_size;
21 struct mutex s_bitmap_lock; 21 struct mutex s_bitmap_lock;
22 int s_uid; 22 kuid_t s_uid;
23 int s_gid; 23 kgid_t s_gid;
24 int s_dmask; 24 int s_dmask;
25 int s_fmask; 25 int s_fmask;
26}; 26};