* [PATCH] ext2fs: fix error handling in ext2fs_add_dir_block
@ 2011-06-10 7:33 Andreas Dilger
2011-06-11 15:55 ` Ted Ts'o
0 siblings, 1 reply; 2+ messages in thread
From: Andreas Dilger @ 2011-06-10 7:33 UTC (permalink / raw)
To: tytso, linux-ext4; +Cc: Andreas Dilger
In ext2fs_add_dir_block() the dblist allocation size was changed to
grow as the number of items in the dblist increases. However, the
error handling in case of allocation failure wasn't changed to match.
Fix the error case to revert to the old allocation size on failure.
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
---
lib/ext2fs/dblist.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/ext2fs/dblist.c b/lib/ext2fs/dblist.c
index 8ee61b4..c0a3dfe 100644
--- a/lib/ext2fs/dblist.c
+++ b/lib/ext2fs/dblist.c
@@ -172,7 +172,7 @@ errcode_t ext2fs_add_dir_block2(ext2_dblist dblist, ext2_ino_t ino,
sizeof(struct ext2_db_entry2),
&dblist->list);
if (retval) {
- dblist->size -= 100;
+ dblist->size = old_size / sizeof(struct ext2_db_entry2);
return retval;
}
}
--
1.7.3.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ext2fs: fix error handling in ext2fs_add_dir_block
2011-06-10 7:33 [PATCH] ext2fs: fix error handling in ext2fs_add_dir_block Andreas Dilger
@ 2011-06-11 15:55 ` Ted Ts'o
0 siblings, 0 replies; 2+ messages in thread
From: Ted Ts'o @ 2011-06-11 15:55 UTC (permalink / raw)
To: Andreas Dilger; +Cc: linux-ext4
On Fri, Jun 10, 2011 at 01:33:07AM -0600, Andreas Dilger wrote:
> In ext2fs_add_dir_block() the dblist allocation size was changed to
> grow as the number of items in the dblist increases. However, the
> error handling in case of allocation failure wasn't changed to match.
>
> Fix the error case to revert to the old allocation size on failure.
>
> Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Added to the maint branch, thanks!
- Ted
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-06-11 15:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-10 7:33 [PATCH] ext2fs: fix error handling in ext2fs_add_dir_block Andreas Dilger
2011-06-11 15:55 ` Ted Ts'o
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).