[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1307691187-12854-1-git-send-email-adilger@whamcloud.com>
Date: Fri, 10 Jun 2011 01:33:07 -0600
From: Andreas Dilger <adilger@...mcloud.com>
To: tytso@....edu, linux-ext4@...r.kernel.org
Cc: Andreas Dilger <adilger@...mcloud.com>
Subject: [PATCH] ext2fs: fix error handling in ext2fs_add_dir_block
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@...mcloud.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
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists