2010-04-07 13:25:55

by jing zhang

[permalink] [raw]
Subject: [PATCH] ext4: check for EXT4_MB_HINT_NOPREALLOC is added in ext4_mb_use_preallocated()

From: Jing Zhang <[email protected]>

Date: Wed Apr 7 21:23:48 2010

Since preallocation may not be require by allocation request, check
for it in ext4_mb_use_preallocated() seems necessary.

Cc: Theodore Ts'o <[email protected]>
Cc: Andreas Dilger <[email protected]>
Cc: Dave Kleikamp <[email protected]>
Cc: Aneesh Kumar K. V <[email protected]>
Signed-off-by: Jing Zhang <[email protected]>

---

--- linux-2.6.32/fs/ext4/mballoc.c 2009-12-03 11:51:22.000000000 +0800
+++ ext4_mm_leak/mballoc-15.c 2010-04-07 20:16:22.000000000 +0800
@@ -3101,6 +3101,8 @@ ext4_mb_use_preallocated(struct ext4_all
/* only data can be preallocated */
if (!(ac->ac_flags & EXT4_MB_HINT_DATA))
return 0;
+ if (ac->ac_flags & EXT4_MB_HINT_NOPREALLOC)
+ return 0;

/* first, try per-file preallocation */
rcu_read_lock();


2010-04-07 15:57:24

by Theodore Ts'o

[permalink] [raw]
Subject: Re: [PATCH] ext4: check for EXT4_MB_HINT_NOPREALLOC is added in ext4_mb_use_preallocated()

On Wed, Apr 07, 2010 at 09:25:53PM +0800, jing zhang wrote:
> From: Jing Zhang <[email protected]>
>
> Date: Wed Apr 7 21:23:48 2010
>
> Since preallocation may not be require by allocation request, check
> for it in ext4_mb_use_preallocated() seems necessary.

NACK. If there is a file-specific preallocation that had been created
from a previous allocation (that wasn't completely used up), we want
to use it up, even if we don't want to create any new per-file
preallocations.

- Ted