Whamcloud - gitweb
LU-2555 fsfilt: fix race in ldiskfs_ext_new_extent_cb
authorNiu Yawei <niu@whamcloud.com>
Sat, 5 Jan 2013 09:00:27 +0000 (04:00 -0500)
committerOleg Drokin <green@whamcloud.com>
Tue, 22 Jan 2013 20:09:51 +0000 (15:09 -0500)
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()).

Signed-off-by: Niu Yawei <niu@whamcloud.com>
Change-Id: I04dada849a71228980501ab7eb1cc9ab71ca3782
Reviewed-on: http://review.whamcloud.com/4957
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: Bobi Jam <bobijam@gmail.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
ldiskfs/kernel_patches/patches/ext4-misc-rhel6.patch

index eac6168..f84dda6 100644 (file)
@@ -99,7 +99,7 @@ Index: linux-stage/fs/ext4/extents.c
 +
 +      if (path) {
 +              /* probably there is space in leaf? */
 +
 +      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;
 +              if (le16_to_cpu(path[depth].p_hdr->eh_entries)
 +                              < le16_to_cpu(path[depth].p_hdr->eh_max))
 +                      return 1;