call unmap_underlying_metadata() on every allocated
block. otherwise metadata blocks released in a previous
transaction can be written by the kernel corrupting
user's data. pblock != 0 should be a good sign of that.
Change-Id: I0d06611feb384a3f7ef5d8e5b34951822369ed0f
Signed-off-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-on: http://review.whamcloud.com/15593
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Reviewed-by: Niu Yawei <yawei.niu@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
{
struct bpointers *bp = cbdata;
struct ldiskfs_extent nex;
- unsigned long pblock;
+ unsigned long pblock = 0;
unsigned long tgen;
int err, i;
unsigned long count;
i, cex->ec_len);
for (; i < cex->ec_len && bp->num; i++) {
*(bp->blocks) = cex->ec_start + i;
-#ifdef LDISKFS_EXT_CACHE_EXTENT /* until kernel 2.6.37 */
- if (cex->ec_type != LDISKFS_EXT_CACHE_EXTENT) {
-#else
- if ((cex->ec_len == 0) || (cex->ec_start == 0)) {
-#endif
+ if (pblock != 0) {
/* unmap any possible underlying metadata from
* the block device mapping. bug 6998. */
unmap_underlying_metadata(inode->i_sb->s_bdev,