Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 4680
b: refs/heads/master
c: 50a5223
h: refs/heads/master
v: v3
  • Loading branch information
Jan Kara authored and Linus Torvalds committed Jul 12, 2005
1 parent e0c8d98 commit b8019c0
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 4 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: 08c6a96fd77836856c090ebb39beadc81cb8484d
refs/heads/master: 50a5223428bbe77bc0f312100c950b6f4520ba34
9 changes: 9 additions & 0 deletions trunk/fs/ext2/ext2.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
#include <linux/fs.h>
#include <linux/ext2_fs.h>

/*
* ext2 mount options
*/
struct ext2_mount_options {
unsigned long s_mount_opt;
uid_t s_resuid;
gid_t s_resgid;
};

/*
* second extended file system inode data in memory
*/
Expand Down
24 changes: 21 additions & 3 deletions trunk/fs/ext2/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -936,12 +936,23 @@ static int ext2_remount (struct super_block * sb, int * flags, char * data)
struct ext2_sb_info * sbi = EXT2_SB(sb);
struct ext2_super_block * es;
unsigned long old_mount_opt = sbi->s_mount_opt;
struct ext2_mount_options old_opts;
unsigned long old_sb_flags;
int err;

/* Store the old options */
old_sb_flags = sb->s_flags;
old_opts.s_mount_opt = sbi->s_mount_opt;
old_opts.s_resuid = sbi->s_resuid;
old_opts.s_resgid = sbi->s_resgid;

/*
* Allow the "check" option to be passed as a remount option.
*/
if (!parse_options (data, sbi))
return -EINVAL;
if (!parse_options (data, sbi)) {
err = -EINVAL;
goto restore_opts;
}

sb->s_flags = (sb->s_flags & ~MS_POSIXACL) |
((sbi->s_mount_opt & EXT2_MOUNT_POSIX_ACL) ? MS_POSIXACL : 0);
Expand Down Expand Up @@ -971,7 +982,8 @@ static int ext2_remount (struct super_block * sb, int * flags, char * data)
printk("EXT2-fs: %s: couldn't remount RDWR because of "
"unsupported optional features (%x).\n",
sb->s_id, le32_to_cpu(ret));
return -EROFS;
err = -EROFS;
goto restore_opts;
}
/*
* Mounting a RDONLY partition read-write, so reread and
Expand All @@ -984,6 +996,12 @@ static int ext2_remount (struct super_block * sb, int * flags, char * data)
}
ext2_sync_super(sb, es);
return 0;
restore_opts:
sbi->s_mount_opt = old_opts.s_mount_opt;
sbi->s_resuid = old_opts.s_resuid;
sbi->s_resgid = old_opts.s_resgid;
sb->s_flags = old_sb_flags;
return err;
}

static int ext2_statfs (struct super_block * sb, struct kstatfs * buf)
Expand Down

0 comments on commit b8019c0

Please sign in to comment.