This patch fixes another case where the truncate write intent
extent is set incorrectly. This may cause errors when truncating
PFL files to exactly the boundary between two extents.
Fixes:
c32c7401426d ("LU-12586 lov: Correct write_intent end for trunc")
Signed-off-by: Bobi Jam <bobijam@whamcloud.com>
Change-Id: I40f14a48c53bfd1e6442e4414ee30f9eb159fc02
Reviewed-on: https://review.whamcloud.com/38412
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Wang Shilong <wshilong@whamcloud.com>
Reviewed-by: Li Dongyang <dongyangli@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
/**
* for truncate, we uses [size, EOF) to judge whether
* a write intent needs to be send, but we need to
- * restore the write extent to [0, size).
+ * restore the write extent to [0, size], in truncate,
+ * the byte in the size position is accessed.
*/
io->ci_write_intent.e_start = 0;
io->ci_write_intent.e_end =
- io->u.ci_setattr.sa_attr.lvb_size;
+ io->u.ci_setattr.sa_attr.lvb_size + 1;
}
/* stop cl_io_init() loop */
RETURN(1);