Commit 2b0b39517d1af5294128dbc2fd7ed39c8effa540
Committed by
Dave Kleikamp
1 parent
d7eecb483c
Exists in
master
and in
7 other branches
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: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Dave Kleikamp <shaggy@linux.vnet.ibm.com> Cc: jfs-discussion@lists.sourceforge.net Cc: linux-kernel@vger.kernel.org
Showing 1 changed file with 5 additions and 1 deletions Side-by-side Diff
fs/jfs/resize.c
... | ... | @@ -81,6 +81,7 @@ |
81 | 81 | struct inode *iplist[1]; |
82 | 82 | struct jfs_superblock *j_sb, *j_sb2; |
83 | 83 | uint old_agsize; |
84 | + int agsizechanged = 0; | |
84 | 85 | struct buffer_head *bh, *bh2; |
85 | 86 | |
86 | 87 | /* If the volume hasn't grown, get out now */ |
... | ... | @@ -333,6 +334,9 @@ |
333 | 334 | */ |
334 | 335 | if ((rc = dbExtendFS(ipbmap, XAddress, nblocks))) |
335 | 336 | goto error_out; |
337 | + | |
338 | + agsizechanged |= (bmp->db_agsize != old_agsize); | |
339 | + | |
336 | 340 | /* |
337 | 341 | * the map now has extended to cover additional nblocks: |
338 | 342 | * dn_mapsize = oldMapsize + nblocks; |
... | ... | @@ -432,7 +436,7 @@ |
432 | 436 | * will correctly identify the new ag); |
433 | 437 | */ |
434 | 438 | /* if new AG size the same as old AG size, done! */ |
435 | - if (bmp->db_agsize != old_agsize) { | |
439 | + if (agsizechanged) { | |
436 | 440 | if ((rc = diExtendFS(ipimap, ipbmap))) |
437 | 441 | goto error_out; |
438 | 442 |