From 3e14e50be4e4085c3f298eafaf24490fe63fa819 Mon Sep 17 00:00:00 2001 From: adilger Date: Wed, 6 Jul 2005 02:36:02 +0000 Subject: [PATCH] Branch b1_4 OSTs running 2.4 kernels but with extents enabled might rarely trip an assertion in the ext3 JBD (journaling) layer. The b_committed_data struct is protected by the big kernel lock in 2.4 kernels, serializing journal_commit_transaction() and ext3_get_block_handle->ext3_new_block->find_next_usable_block() access to this struct. In 2.6 kernels there is finer grained locking to improve SMP performance of the JBD layer. b=6198 r=alex (original patch) --- lustre/ChangeLog | 14 +++++++++++++- .../kernel_patches/patches/ext3-extents-2.4.21-chaos.patch | 8 +++++++- .../kernel_patches/patches/ext3-extents-2.4.21-suse2.patch | 8 +++++++- lustre/kernel_patches/patches/ext3-extents-2.4.24.patch | 8 +++++++- lustre/kernel_patches/patches/ext3-extents-2.4.29.patch | 8 +++++++- lustre/lvfs/fsfilt_ext3.c | 2 ++ 6 files changed, 43 insertions(+), 5 deletions(-) diff --git a/lustre/ChangeLog b/lustre/ChangeLog index db5aabb..bef3abf 100644 --- a/lustre/ChangeLog +++ b/lustre/ChangeLog @@ -69,9 +69,21 @@ Severity : enhancement Bugzilla : 6931 Description: Provide flock support for clients Details : Implement fcntl advisory locking and file status functions. - This feature is provided as an optional mount flag: + This feature is provided as an optional mount flag (default + off), and is not supported for all types of record locking. mount -t lustre -o [flock|noflock] ... +Severity : major +Frequency : occasional +Bugzilla : 6198 +Description: OSTs running 2.4 kernels but with extents enabled might trip an + assertion in the ext3 JBD (journaling) layer. +Details : The b_committed_data struct is protected by the big kernel lock + in 2.4 kernels, serializing journal_commit_transaction() and + ext3_get_block_handle->ext3_new_block->find_next_usable_block() + access to this struct. In 2.6 kernels there is finer grained + locking to improve SMP performance of the JBD layer. + ------------------------------------------------------------------------------ diff --git a/lustre/kernel_patches/patches/ext3-extents-2.4.21-chaos.patch b/lustre/kernel_patches/patches/ext3-extents-2.4.21-chaos.patch index 5ef713b..68e52bb 100644 --- a/lustre/kernel_patches/patches/ext3-extents-2.4.21-chaos.patch +++ b/lustre/kernel_patches/patches/ext3-extents-2.4.21-chaos.patch @@ -2,7 +2,7 @@ Index: linux-2.4.21-rhel/fs/ext3/extents.c =================================================================== --- linux-2.4.21-rhel.orig/fs/ext3/extents.c 2005-03-02 22:42:20.659360368 +0300 +++ linux-2.4.21-rhel/fs/ext3/extents.c 2005-03-04 02:34:52.000000000 +0300 -@@ -0,0 +1,2312 @@ +@@ -0,0 +1,2318 @@ +/* + * Copyright(c) 2003, 2004, 2005, Cluster File Systems, Inc, info@clusterfs.com + * Written by Alex Tomas @@ -171,7 +171,9 @@ Index: linux-2.4.21-rhel/fs/ext3/extents.c + goal = bg_start + colour; + } + ++ lock_kernel(); + newblock = ext3_new_block(handle, inode, goal, 0, 0, err); ++ unlock_kernel(); + return newblock; +} + @@ -1965,7 +1967,9 @@ Index: linux-2.4.21-rhel/fs/ext3/extents.c + ex->ee_len = 1; + /* allocate new block for the extent */ + goal = ext3_ext_find_goal(inode, path, ex->ee_block); ++ lock_kernel(); + ex->ee_start = ext3_new_block(handle, inode, goal, 0, 0, err); ++ unlock_kernel(); + if (ex->ee_start == 0) { + /* error occured: restore old extent */ + ex->ee_start = newblock; @@ -2071,7 +2075,9 @@ Index: linux-2.4.21-rhel/fs/ext3/extents.c + + /* allocate new block */ + goal = ext3_ext_find_goal(inode, path, iblock); ++ lock_kernel(); + newblock = ext3_new_block(handle, inode, goal, 0, 0, &err); ++ unlock_kernel(); + if (!newblock) + goto out2; + ext_debug(&tree, "allocate new block: goal %d, found %d\n", diff --git a/lustre/kernel_patches/patches/ext3-extents-2.4.21-suse2.patch b/lustre/kernel_patches/patches/ext3-extents-2.4.21-suse2.patch index 53cb38e..fb7d2cb 100644 --- a/lustre/kernel_patches/patches/ext3-extents-2.4.21-suse2.patch +++ b/lustre/kernel_patches/patches/ext3-extents-2.4.21-suse2.patch @@ -2,7 +2,7 @@ Index: linux-2.4.21-suse2/fs/ext3/extents.c =================================================================== --- linux-2.4.21-suse2.orig/fs/ext3/extents.c 2003-01-30 13:24:37.000000000 +0300 +++ linux-2.4.21-suse2/fs/ext3/extents.c 2004-11-03 00:34:45.404241880 +0300 -@@ -0,0 +1,2303 @@ +@@ -0,0 +1,2309 @@ +/* + * Copyright(c) 2003, 2004, 2005, Cluster File Systems, Inc, info@clusterfs.com + * Written by Alex Tomas @@ -171,7 +171,9 @@ Index: linux-2.4.21-suse2/fs/ext3/extents.c + goal = bg_start + colour; + } + ++ lock_kernel(); + newblock = ext3_new_block(handle, inode, goal, 0, 0, err); ++ unlock_kernel(); + return newblock; +} + @@ -1965,7 +1967,9 @@ Index: linux-2.4.21-suse2/fs/ext3/extents.c + ex->ee_len = 1; + /* allocate new block for the extent */ + goal = ext3_ext_find_goal(inode, path, ex->ee_block); ++ lock_kernel(); + ex->ee_start = ext3_new_block(handle, inode, goal, 0, 0, err); ++ unlock_kernel(); + if (ex->ee_start == 0) { + /* error occured: restore old extent */ + ex->ee_start = newblock; @@ -2071,7 +2075,9 @@ Index: linux-2.4.21-suse2/fs/ext3/extents.c + + /* allocate new block */ + goal = ext3_ext_find_goal(inode, path, iblock); ++ lock_kernel(); + newblock = ext3_new_block(handle, inode, goal, 0, 0, &err); ++ unlock_kernel(); + if (!newblock) + goto out2; + ext_debug(&tree, "allocate new block: goal %d, found %d\n", diff --git a/lustre/kernel_patches/patches/ext3-extents-2.4.24.patch b/lustre/kernel_patches/patches/ext3-extents-2.4.24.patch index 3364139..7246be1 100644 --- a/lustre/kernel_patches/patches/ext3-extents-2.4.24.patch +++ b/lustre/kernel_patches/patches/ext3-extents-2.4.24.patch @@ -2,7 +2,7 @@ Index: linux-2.4.24/fs/ext3/extents.c =================================================================== --- linux-2.4.24.orig/fs/ext3/extents.c 2003-01-30 13:24:37.000000000 +0300 +++ linux-2.4.24/fs/ext3/extents.c 2004-11-03 00:36:44.894076664 +0300 -@@ -0,0 +1,2302 @@ +@@ -0,0 +1,2308 @@ +/* + * Copyright(c) 2003, 2004, 2005, Cluster File Systems, Inc, info@clusterfs.com + * Written by Alex Tomas @@ -171,7 +171,9 @@ Index: linux-2.4.24/fs/ext3/extents.c + goal = bg_start + colour; + } + ++ lock_kernel(); + newblock = ext3_new_block(handle, inode, goal, 0, 0, err); ++ unlock_kernel(); + return newblock; +} + @@ -1964,7 +1966,9 @@ Index: linux-2.4.24/fs/ext3/extents.c + ex->ee_len = 1; + /* allocate new block for the extent */ + goal = ext3_ext_find_goal(inode, path, ex->ee_block); ++ lock_kernel(); + ex->ee_start = ext3_new_block(handle, inode, goal, 0, 0, err); ++ unlock_kernel(); + if (ex->ee_start == 0) { + /* error occured: restore old extent */ + ex->ee_start = newblock; @@ -2070,7 +2074,9 @@ Index: linux-2.4.24/fs/ext3/extents.c + + /* allocate new block */ + goal = ext3_ext_find_goal(inode, path, iblock); ++ lock_kernel(); + newblock = ext3_new_block(handle, inode, goal, 0, 0, &err); ++ unlock_kernel(); + if (!newblock) + goto out2; + ext_debug(&tree, "allocate new block: goal %d, found %d\n", diff --git a/lustre/kernel_patches/patches/ext3-extents-2.4.29.patch b/lustre/kernel_patches/patches/ext3-extents-2.4.29.patch index 11acf5c..d030f04 100644 --- a/lustre/kernel_patches/patches/ext3-extents-2.4.29.patch +++ b/lustre/kernel_patches/patches/ext3-extents-2.4.29.patch @@ -2,7 +2,7 @@ Index: linux-2.4.29/fs/ext3/extents.c =================================================================== --- linux-2.4.29.orig/fs/ext3/extents.c 2005-05-03 16:52:08.723069952 +0300 +++ linux-2.4.29/fs/ext3/extents.c 2005-05-03 16:52:08.802057944 +0300 -@@ -0,0 +1,2302 @@ +@@ -0,0 +1,2308 @@ +/* + * Copyright(c) 2003, 2004, 2005, Cluster File Systems, Inc, info@clusterfs.com + * Written by Alex Tomas @@ -171,7 +171,9 @@ Index: linux-2.4.29/fs/ext3/extents.c + goal = bg_start + colour; + } + ++ lock_kernel(); + newblock = ext3_new_block(handle, inode, goal, 0, 0, err); ++ unlock_kernel(); + return newblock; +} + @@ -1964,7 +1966,9 @@ Index: linux-2.4.29/fs/ext3/extents.c + ex->ee_len = 1; + /* allocate new block for the extent */ + goal = ext3_ext_find_goal(inode, path, ex->ee_block); ++ lock_kernel(); + ex->ee_start = ext3_new_block(handle, inode, goal, 0, 0, err); ++ unlock_kernel(); + if (ex->ee_start == 0) { + /* error occured: restore old extent */ + ex->ee_start = newblock; @@ -2070,7 +2074,9 @@ Index: linux-2.4.29/fs/ext3/extents.c + + /* allocate new block */ + goal = ext3_ext_find_goal(inode, path, iblock); ++ lock_kernel(); + newblock = ext3_new_block(handle, inode, goal, 0, 0, &err); ++ unlock_kernel(); + if (!newblock) + goto out2; + ext_debug(&tree, "allocate new block: goal %d, found %d\n", diff --git a/lustre/lvfs/fsfilt_ext3.c b/lustre/lvfs/fsfilt_ext3.c index c5ff7a9..4748216 100644 --- a/lustre/lvfs/fsfilt_ext3.c +++ b/lustre/lvfs/fsfilt_ext3.c @@ -812,7 +812,9 @@ static int ext3_ext_new_extent_cb(struct ext3_extents_tree *tree, count = cex->ec_len; goal = ext3_ext_find_goal(inode, path, cex->ec_block, &aflags); aflags |= 2; /* block have been already reserved */ + lock_24kernel(); pblock = ext3_mb_new_blocks(handle, inode, goal, &count, aflags, &err); + unlock_24kernel(); if (!pblock) goto out; EXT_ASSERT(count <= cex->ec_len); -- 1.8.3.1