* [PATCH] jfs: fix diAllocExt error in resizing filesystem
@ 2010-04-14 19:56 Bill Pemberton
2010-04-14 20:02 ` Dave Kleikamp
0 siblings, 1 reply; 2+ messages in thread
From: Bill Pemberton @ 2010-04-14 19:56 UTC (permalink / raw)
To: shaggy; +Cc: jfs-discussion, linux-kernel
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>
---
fs/jfs/resize.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/fs/jfs/resize.c b/fs/jfs/resize.c
index 7f24a0b..1aba003 100644
--- a/fs/jfs/resize.c
+++ b/fs/jfs/resize.c
@@ -81,6 +81,7 @@ int jfs_extendfs(struct super_block *sb, s64 newLVSize, int newLogSize)
struct inode *iplist[1];
struct jfs_superblock *j_sb, *j_sb2;
uint old_agsize;
+ int agsizechanged = 0;
struct buffer_head *bh, *bh2;
/* If the volume hasn't grown, get out now */
@@ -333,6 +334,9 @@ int jfs_extendfs(struct super_block *sb, s64 newLVSize, int newLogSize)
*/
if ((rc = dbExtendFS(ipbmap, XAddress, nblocks)))
goto error_out;
+
+ agsizechanged |= (bmp->db_agsize != old_agsize);
+
/*
* the map now has extended to cover additional nblocks:
* dn_mapsize = oldMapsize + nblocks;
@@ -432,7 +436,7 @@ int jfs_extendfs(struct super_block *sb, s64 newLVSize, int newLogSize)
* will correctly identify the new ag);
*/
/* if new AG size the same as old AG size, done! */
- if (bmp->db_agsize != old_agsize) {
+ if (agsizechanged) {
if ((rc = diExtendFS(ipimap, ipbmap)))
goto error_out;
--
1.6.6.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] jfs: fix diAllocExt error in resizing filesystem
2010-04-14 19:56 [PATCH] jfs: fix diAllocExt error in resizing filesystem Bill Pemberton
@ 2010-04-14 20:02 ` Dave Kleikamp
0 siblings, 0 replies; 2+ messages in thread
From: Dave Kleikamp @ 2010-04-14 20:02 UTC (permalink / raw)
To: Bill Pemberton; +Cc: jfs-discussion, linux-kernel
On Wed, 2010-04-14 at 15:56 -0400, Bill Pemberton wrote:
> 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.
Awesome! This bug has been frustrating me for a while, but I hadn't
chased it down to the root cause. I'll give a bit of a test and push it
upstream!
Thanks,
Shaggy
>
> Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
> ---
> fs/jfs/resize.c | 6 +++++-
> 1 files changed, 5 insertions(+), 1 deletions(-)
>
> diff --git a/fs/jfs/resize.c b/fs/jfs/resize.c
> index 7f24a0b..1aba003 100644
> --- a/fs/jfs/resize.c
> +++ b/fs/jfs/resize.c
> @@ -81,6 +81,7 @@ int jfs_extendfs(struct super_block *sb, s64 newLVSize, int newLogSize)
> struct inode *iplist[1];
> struct jfs_superblock *j_sb, *j_sb2;
> uint old_agsize;
> + int agsizechanged = 0;
> struct buffer_head *bh, *bh2;
>
> /* If the volume hasn't grown, get out now */
> @@ -333,6 +334,9 @@ int jfs_extendfs(struct super_block *sb, s64 newLVSize, int newLogSize)
> */
> if ((rc = dbExtendFS(ipbmap, XAddress, nblocks)))
> goto error_out;
> +
> + agsizechanged |= (bmp->db_agsize != old_agsize);
> +
> /*
> * the map now has extended to cover additional nblocks:
> * dn_mapsize = oldMapsize + nblocks;
> @@ -432,7 +436,7 @@ int jfs_extendfs(struct super_block *sb, s64 newLVSize, int newLogSize)
> * will correctly identify the new ag);
> */
> /* if new AG size the same as old AG size, done! */
> - if (bmp->db_agsize != old_agsize) {
> + if (agsizechanged) {
> if ((rc = diExtendFS(ipimap, ipbmap)))
> goto error_out;
>
--
Dave Kleikamp
IBM Linux Technology Center
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-04-14 20:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-14 19:56 [PATCH] jfs: fix diAllocExt error in resizing filesystem Bill Pemberton
2010-04-14 20:02 ` Dave Kleikamp
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.