From d5f3e8847a5ebc87145d2b91522bbd40a7658ef1 Mon Sep 17 00:00:00 2001 From: "Aneesh Kumar K.V" Date: Tue, 29 Apr 2008 08:11:12 -0400 Subject: [PATCH] --- yaml --- r: 95032 b: refs/heads/master c: e067ba0078cd6f00eb6c4052fec630b78ebe59de h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/ext4/extents.c | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 94a66657d234..f73bb6f93fd7 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: fd28784adc079afa905df56204b1298ddb4d0bfe +refs/heads/master: e067ba0078cd6f00eb6c4052fec630b78ebe59de diff --git a/trunk/fs/ext4/extents.c b/trunk/fs/ext4/extents.c index c2b004e29ad8..f4ef0b745a53 100644 --- a/trunk/fs/ext4/extents.c +++ b/trunk/fs/ext4/extents.c @@ -2570,8 +2570,18 @@ int ext4_ext_get_blocks(handle_t *handle, struct inode *inode, } if (create == EXT4_CREATE_UNINITIALIZED_EXT) goto out; - if (!create) + if (!create) { + /* + * We have blocks reserved already. We + * return allocated blocks so that delalloc + * won't do block reservation for us. But + * the buffer head will be unmapped so that + * a read from the block returns 0s. + */ + if (allocated > max_blocks) + allocated = max_blocks; goto out2; + } ret = ext4_ext_convert_to_initialized(handle, inode, path, iblock,