This is a note to let you know that I've just added the patch titled

    ext4: free allocated and pre-allocated blocks when

to the 3.0-stable tree which can be found at:
    
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     ext4-free-allocated-and-pre-allocated-blocks-when.patch
and it can be found in the queue-3.0 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.


>From 575a1d4bdfa2ea9fc10733013136145b497e1be0 Mon Sep 17 00:00:00 2001
From: Jiaying Zhang <[email protected]>
Date: Sun, 10 Jul 2011 20:07:25 -0400
Subject: ext4: free allocated and pre-allocated blocks when
 check_eofblocks_fl fails

From: Jiaying Zhang <[email protected]>

commit 575a1d4bdfa2ea9fc10733013136145b497e1be0 upstream.

Upon corrupted inode or disk failures, we may fail after we already
allocate some blocks from the inode or take some blocks from the
inode's preallocation list, but before we successfully insert the
corresponding extent to the extent tree. In this case, we should free
any allocated blocks and discard the inode's preallocated blocks
because the entries in the inode's preallocation list may be in an
inconsistent state.

Signed-off-by: Jiaying Zhang <[email protected]>
Signed-off-by: "Theodore Ts'o" <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
 fs/ext4/extents.c |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -3596,10 +3596,9 @@ int ext4_ext_map_blocks(handle_t *handle
        }
 
        err = check_eofblocks_fl(handle, inode, map->m_lblk, path, ar.len);
-       if (err)
-               goto out2;
-
-       err = ext4_ext_insert_extent(handle, inode, path, &newex, flags);
+       if (!err)
+               err = ext4_ext_insert_extent(handle, inode, path,
+                                            &newex, flags);
        if (err) {
                int fb_flags = flags & EXT4_GET_BLOCKS_DELALLOC_RESERVE ?
                        EXT4_FREE_BLOCKS_NO_QUOT_UPDATE : 0;


Patches currently in stable-queue which might be from [email protected] are

queue-3.0/ext4-free-allocated-and-pre-allocated-blocks-when.patch

_______________________________________________
stable mailing list
[email protected]
http://linux.kernel.org/mailman/listinfo/stable

Reply via email to