Whamcloud - gitweb
LU-4853 ldiskfs: fix race in ldiskfs_ext_new_extent_cb 68/9868/3
authorNiu Yawei <yawei.niu@intel.com>
Wed, 2 Apr 2014 12:44:00 +0000 (08:44 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Fri, 4 Apr 2014 22:32:44 +0000 (22:32 +0000)
In ldiskfs_ext_calc_credits_for_insert(), we should use the 'depth'
stored in the 'path' instead from inode, because the extent tree
could have been changed when ldiskfs_ext_calc_credits_for_insert()
is called (by ldiskfs_ext_new_extent_cb()).

It was fixed in LU-2555, but the fix is missed in
sles11sp2/ext4-misc.patch

Signed-off-by: Niu Yawei <yawei.niu@intel.com>
Change-Id: I9ca349ba52060f10fc980721317ba47e10572473
Reviewed-on: http://review.whamcloud.com/9868
Tested-by: Jenkins
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Jian Yu <jian.yu@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
ldiskfs/kernel_patches/patches/sles11sp2/ext4-misc.patch

index efa3eae..6e5e191 100644 (file)
@@ -99,7 +99,7 @@
 +
 +      if (path) {
 +              /* probably there is space in leaf? */
-+              depth = ext_depth(inode);
++              depth = path->p_depth;
 +              if (le16_to_cpu(path[depth].p_hdr->eh_entries)
 +                              < le16_to_cpu(path[depth].p_hdr->eh_max))
 +                      return 1;