Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9df5643ad135c7f8c02d3b69020de4ec910f9fc0
Commit:     9df5643ad135c7f8c02d3b69020de4ec910f9fc0
Parent:     b35905c16ad6428551eb9e49525011bd2700cf56
Author:     Aneesh Kumar K.V <[EMAIL PROTECTED]>
AuthorDate: Fri Feb 22 06:17:31 2008 -0500
Committer:  Theodore Ts'o <[EMAIL PROTECTED]>
CommitDate: Fri Feb 22 06:17:31 2008 -0500

    ext4: Get journal write access before modifying the extent tree
    
    When the user was writing into an unitialized extent,
    ext4_ext_convert_to_initialize() was not requesting journal write access
    before it started to modify the extent tree.   Fix this oversight.
    
    Signed-off-by: Aneesh Kumar K.V <[EMAIL PROTECTED]>
    Signed-off-by: Mingming Cao <[EMAIL PROTECTED]>
    Signed-off-by: "Theodore Ts'o" <[EMAIL PROTECTED]>
---
 fs/ext4/extents.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 995ac16..c4d6f19 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -2168,6 +2168,10 @@ static int ext4_ext_convert_to_initialized(handle_t 
*handle,
        newblock = iblock - ee_block + ext_pblock(ex);
        ex2 = ex;
 
+       err = ext4_ext_get_access(handle, inode, path + depth);
+       if (err)
+               goto out;
+
        /* ex1: ee_block to iblock - 1 : uninitialized */
        if (iblock > ee_block) {
                ex1 = ex;
@@ -2210,6 +2214,10 @@ static int ext4_ext_convert_to_initialized(handle_t 
*handle,
                        ex = path[depth].p_ext;
                        if (ex2 != &newex)
                                ex2 = ex;
+
+                       err = ext4_ext_get_access(handle, inode, path + depth);
+                       if (err)
+                               goto out;
                }
                allocated = max_blocks;
        }
@@ -2230,9 +2238,6 @@ static int ext4_ext_convert_to_initialized(handle_t 
*handle,
        ex2->ee_len = cpu_to_le16(allocated);
        if (ex2 != ex)
                goto insert;
-       err = ext4_ext_get_access(handle, inode, path + depth);
-       if (err)
-               goto out;
        /*
         * New (initialized) extent starts from the first block
         * in the current extent. i.e., ex2 == ex
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to