lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Message-Id: <1203712599.3639.55.camel@localhost.localdomain> Date: Fri, 22 Feb 2008 12:36:39 -0800 From: Mingming Cao <cmm@...ibm.com> To: linux-ext4@...r.kernel.org, Alex Tomas <bzzz.tomas@...il.com> Subject: [PATCH] ext4: general handling preallocated blocks in delayed allocation With delayed allocation, get_block() is only doing block map at the write_begin() time. If the blocks are prea-allocated, the result bh is not mapped, but the blocks are actually being allocated. delalloc should not treat it as other regular unallocated area, thus mark it as need block allocation later, and doing extra reservation incorrectly. Signed-off-by: Mingming Cao <cmm@...ibm.com> --- fs/ext4/inode.c | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) Index: linux-2.6.25-rc2/fs/ext4/inode.c =================================================================== --- linux-2.6.25-rc2.orig/fs/ext4/inode.c 2008-02-19 14:57:00.000000000 -0800 +++ linux-2.6.25-rc2/fs/ext4/inode.c 2008-02-19 15:04:56.000000000 -0800 @@ -1401,20 +1401,18 @@ static int ext4_da_get_block_prep(struct * XXX: when the filesystem has a lot of free blocks, we could * reserve even allocated blocks to save this lookup */ ret = ext4_get_blocks_wrap(NULL, inode, iblock, 1, bh_result, 0, 0); - if (ret >= 0) { - if (buffer_mapped(bh_result)) { - bh_result->b_size = (ret << inode->i_blkbits); - } else { - /* the block isn't allocated yet, let's reserve space */ - /* XXX: call reservation here */ - /* - * XXX: __block_prepare_write() unmaps passed block, - * is it OK? - */ - map_bh(bh_result, inode->i_sb, 0); - set_buffer_new(bh_result); - set_buffer_delay(bh_result); - } + if (ret == 0) { + /* the block isn't allocated yet, let's reserve space */ + /* XXX: call reservation here */ + /* + * XXX: __block_prepare_write() unmaps passed block, + * is it OK? + */ + map_bh(bh_result, inode->i_sb, 0); + set_buffer_new(bh_result); + set_buffer_delay(bh_result); + } else if ((ret > 0) && (buffer_mapped(bh_result))) { + bh_result->b_size = (ret << inode->i_blkbits); ret = 0; } - 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