summaryrefslogtreecommitdiff
path: root/fs/ext2
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2004-04-12 01:02:11 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-04-12 01:02:11 -0700
commit27efbbafb2201ec9d5d83ca44e39a0f1f911c110 (patch)
tree7bde6f8c89bfc37c8f7c2a04e63e391fd548e0bb /fs/ext2
parentdbb1a307d5ba76355030e7bb4200fbef1a659539 (diff)
[PATCH] ext2fs sb= mount option fix
From: <achurch@achurch.org> (Andrew Church) The following patch fixes a bug in the processing of the sb= (alternate superblock) mount option for ext2: when changing the device block size, the given superblock is ignored and the code reverts to using block 1.
Diffstat (limited to 'fs/ext2')
-rw-r--r--fs/ext2/super.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/ext2/super.c b/fs/ext2/super.c
index 6ab37ccf95ba..3a06830a55fc 100644
--- a/fs/ext2/super.c
+++ b/fs/ext2/super.c
@@ -564,8 +564,9 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent)
struct ext2_sb_info * sbi;
struct ext2_super_block * es;
struct inode *root;
- unsigned long block, sb_block = 1;
- unsigned long logic_sb_block = get_sb_block(&data);
+ unsigned long block;
+ unsigned long sb_block = get_sb_block(&data);
+ unsigned long logic_sb_block;
unsigned long offset = 0;
unsigned long def_mount_opts;
int blocksize = BLOCK_SIZE;
@@ -598,6 +599,8 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent)
if (blocksize != BLOCK_SIZE) {
logic_sb_block = (sb_block*BLOCK_SIZE) / blocksize;
offset = (sb_block*BLOCK_SIZE) % blocksize;
+ } else {
+ logic_sb_block = sb_block;
}
if (!(bh = sb_bread(sb, logic_sb_block))) {