ext4: Retry block allocation if we have free blocks left
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Tue, 16 Mar 2010 00:26:00 +0000 (20:26 -0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 26 May 2010 21:27:06 +0000 (14:27 -0700)
commitdf104d2bff4a2d6cf32c29aa599c79d8009fe1a7
treef55fc9c10267aee9c0d1bd42f2919ed8e7c0d1ed
parent8afab7e6fc2a9cedba2d0d3663046c140ef6d60b
ext4: Retry block allocation if we have free blocks left

commit df22291ff0fde0d350cf15dac3e5cc33ac528875 upstream.

When we truncate files, the meta-data blocks released are not reused
untill we commit the truncate transaction.  That means delayed get_block
request will return ENOSPC even if we have free blocks left.  Force a
journal commit and retry block allocation if we get ENOSPC with free
blocks left.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Mingming Cao <cmm@us.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Jayson R. King <dev@jaysonking.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/ext4/inode.c