LU-2072 ldiskfs: Leak of s_mb_prealloc_table in ldiskfs

ext4-prealloc-rhel[5,6] patches adds kmalloc'ed
sbi->s_mb_prealloc_table field which is never freed
in [ldiskfs,ext4]_mb_release()/ext4-vmalloc-rhel[5,6].patch

port of master patch 536464e609c46a3950d7742bc3860b87d6bfc726

Signed-off-by: Bruno Faccini <bruno.faccini@intel.com>
Signed-off-by: Liu Ying <emoly.liu@intel.com>
Change-Id: I0acd9f62d6ffc516540d707830b40c0bd211a43b
LU-2634 ldiskfs: clear extent flag for fast symlink

Fast symlinks on MDT filesystems formatted with the "extents" feature
are created with EXT4_EXTENTS_FL. e2fsck considers this a corruption
and deletes the symlink.

The patch is to clear extent flag in osd_ldiskfs_writelink() just as
ext4_symlink() does.

Signed-off-by: Liu Ying <emoly.liu@intel.com>
Change-Id: Ic0c711cc82de140f86baa71bacd1721fd4a19e07
Reviewed-on: http://review.whamcloud.com/5458
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Bobi Jam <bobijam@gmail.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
LU-2555 ldiskfs: fix ext4_mb_add_n_trim()

In ext4_mb_add_n_trim(), lg_prealloc_lock should be taken
when changing the lg_prealloc_list.

Signed-off-by: Niu Yawei <yawei.niu@intel.com>
Change-Id: I4f3a4b8bc9697b7ccdeade43f5bfd10960533fca
Reviewed-on: http://review.whamcloud.com/4978
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-by: Bobi Jam <bobijam@gmail.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
LU-2555 fsfilt: fix race in ldiskfs_ext_new_extent_cb

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 <yawei.niu@intel.com>
Change-Id: Ie28f7dfc393c8feb8336f6b391cebb0adc814283
Reviewed-on: http://review.whamcloud.com/4977
Tested-by: Hudson
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-by: Bobi Jam <bobijam@gmail.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>