Commit 2b0b3951 authored by Bill Pemberton's avatar Bill Pemberton Committed by Dave Kleikamp

jfs: fix diAllocExt error in resizing filesystem

Resizing the filesystem would result in an diAllocExt error in some
instances because changes in bmp->db_agsize would not get noticed if
goto extendBmap was called.
Signed-off-by: default avatarBill Pemberton <wfp5p@virginia.edu>
Signed-off-by: default avatarDave Kleikamp <shaggy@linux.vnet.ibm.com>
Cc: jfs-discussion@lists.sourceforge.net
Cc: linux-kernel@vger.kernel.org
parent d7eecb48
...@@ -81,6 +81,7 @@ int jfs_extendfs(struct super_block *sb, s64 newLVSize, int newLogSize) ...@@ -81,6 +81,7 @@ int jfs_extendfs(struct super_block *sb, s64 newLVSize, int newLogSize)
struct inode *iplist[1]; struct inode *iplist[1];
struct jfs_superblock *j_sb, *j_sb2; struct jfs_superblock *j_sb, *j_sb2;
uint old_agsize; uint old_agsize;
int agsizechanged = 0;
struct buffer_head *bh, *bh2; struct buffer_head *bh, *bh2;
/* If the volume hasn't grown, get out now */ /* If the volume hasn't grown, get out now */
...@@ -333,6 +334,9 @@ int jfs_extendfs(struct super_block *sb, s64 newLVSize, int newLogSize) ...@@ -333,6 +334,9 @@ int jfs_extendfs(struct super_block *sb, s64 newLVSize, int newLogSize)
*/ */
if ((rc = dbExtendFS(ipbmap, XAddress, nblocks))) if ((rc = dbExtendFS(ipbmap, XAddress, nblocks)))
goto error_out; goto error_out;
agsizechanged |= (bmp->db_agsize != old_agsize);
/* /*
* the map now has extended to cover additional nblocks: * the map now has extended to cover additional nblocks:
* dn_mapsize = oldMapsize + nblocks; * dn_mapsize = oldMapsize + nblocks;
...@@ -432,7 +436,7 @@ int jfs_extendfs(struct super_block *sb, s64 newLVSize, int newLogSize) ...@@ -432,7 +436,7 @@ int jfs_extendfs(struct super_block *sb, s64 newLVSize, int newLogSize)
* will correctly identify the new ag); * will correctly identify the new ag);
*/ */
/* if new AG size the same as old AG size, done! */ /* if new AG size the same as old AG size, done! */
if (bmp->db_agsize != old_agsize) { if (agsizechanged) {
if ((rc = diExtendFS(ipimap, ipbmap))) if ((rc = diExtendFS(ipimap, ipbmap)))
goto error_out; goto error_out;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment