From 9361c115e15f774e1a856b7d3a76f71a63770b93 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Mon, 8 Jun 2015 11:59:56 -0400 Subject: [PATCH] add patch BUG_ON-assertion-repeated-for-inode1-not-done-for-inode2 --- ...sertion-repeated-for-inode1-not-done-for-inode2 | 31 ++++++++++++++++++++++ series | 2 ++ timestamps | 7 ++--- 3 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 BUG_ON-assertion-repeated-for-inode1-not-done-for-inode2 diff --git a/BUG_ON-assertion-repeated-for-inode1-not-done-for-inode2 b/BUG_ON-assertion-repeated-for-inode1-not-done-for-inode2 new file mode 100644 index 00000000..151efc26 --- /dev/null +++ b/BUG_ON-assertion-repeated-for-inode1-not-done-for-inode2 @@ -0,0 +1,31 @@ +ext4: BUG_ON assertion repeated for inode1, not done for inode2 + +From: David Moore + +During a source code review of fs/ext4/extents.c I noted identical +consecutive lines. An assertion is repeated for inode1 and never done +for inode2. This is not in keeping with the rest of the code in the +ext4_swap_extents function and appears to be a bug. + +Assert that the inode2 mutex is not locked. + +Signed-off-by: David Moore +Signed-off-by: Theodore Ts'o +Reviewed-by: Eric Sandeen +--- + fs/ext4/extents.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c +index e003a1e..f38a6d6 100644 +--- a/fs/ext4/extents.c ++++ b/fs/ext4/extents.c +@@ -5542,7 +5542,7 @@ ext4_swap_extents(handle_t *handle, struct inode *inode1, + BUG_ON(!rwsem_is_locked(&EXT4_I(inode1)->i_data_sem)); + BUG_ON(!rwsem_is_locked(&EXT4_I(inode2)->i_data_sem)); + BUG_ON(!mutex_is_locked(&inode1->i_mutex)); +- BUG_ON(!mutex_is_locked(&inode1->i_mutex)); ++ BUG_ON(!mutex_is_locked(&inode2->i_mutex)); + + *erp = ext4_es_remove_extent(inode1, lblk1, count); + if (unlikely(*erp)) diff --git a/series b/series index 7cb4c8b0..7e16843c 100644 --- a/series +++ b/series @@ -31,6 +31,8 @@ try-to-initialize-all-groups-we-can-in-case-of-failure-on-ppc64 return-error-code-from-ext4_mb_good_group fix-ext4_get_crypto_ctx-in-ext4_decrypt_one +BUG_ON-assertion-repeated-for-inode1-not-done-for-inode2 + ########################################## # unstable patches #################################################### diff --git a/timestamps b/timestamps index 4779176b..efaad6b2 100755 --- a/timestamps +++ b/timestamps @@ -50,7 +50,8 @@ touch -d @1433776732 verify-block-bitmap-even-after-fresh-initialization touch -d @1433777917 try-to-initialize-all-groups-we-can-in-case-of-failure-on-ppc64 touch -d @1433778040 return-error-code-from-ext4_mb_good_group touch -d @1433778100 stable-boundary -touch -d @1433778831 series touch -d @1433778896 fix-ext4_get_crypto_ctx-in-ext4_decrypt_one -touch -d @1433778896 status -touch -d @1433779069 timestamps +touch -d @1433779091 series +touch -d @1433779152 BUG_ON-assertion-repeated-for-inode1-not-done-for-inode2 +touch -d @1433779153 status +touch -d @1433779189 timestamps -- 2.11.4.GIT