Whamcloud - gitweb
LU-10509 mdd: don't set size attr for DOM file 08/33008/2
authorMikhail Pershin <mpershin@whamcloud.com>
Wed, 15 Aug 2018 21:15:03 +0000 (00:15 +0300)
committerOleg Drokin <green@whamcloud.com>
Sat, 1 Sep 2018 03:28:54 +0000 (03:28 +0000)
commitf49579786d41d9d8933e50948a6cac342a6f87a6
treee57b5c468604038e33fa8b69df1129eb606235f4
parentb500d5193360711a6c6b07497f34e61cc590cf19
LU-10509 mdd: don't set size attr for DOM file

When client does truncate it calls ll_md_setattr() followed by
ll_setattr_ost() to set size on OSTs. With DOM file that causes
setattr on MDT first including size then PUNCH RPC on the same
object. That was considered as non-optimized situation and
LU-11033 is intended to improve it, but with ZFS there is
check in OSD which does no truncate if size is the same already.
Therefore real file blocks are not truncated actually so sparse
write beyond the end of file will get old data in hole instead of
zeroes.

Quick patch checks if mdd_attr_set() is going to set SIZE attr for
DOM file and clear LA_SIZE bit, assuming there will be truncate.

Complete solution for this will be implemented under LU-11033

Signed-off-by: Mikhail Pershin <mpershin@whamcloud.com>
Change-Id: I47873dccf4270e5f0338f7b6696aa5969cfb9444
Reviewed-on: https://review.whamcloud.com/33008
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: John L. Hammond <jhammond@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/mdd/mdd_object.c