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>
+
+ 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;