Whamcloud - gitweb
LU-12586 lov: Correct write_intent end for trunc 36/35836/2
authorPatrick Farrell <pfarrell@whamcloud.com>
Wed, 24 Jul 2019 19:50:23 +0000 (15:50 -0400)
committerOleg Drokin <green@whamcloud.com>
Wed, 4 Sep 2019 18:33:31 +0000 (18:33 +0000)
commitad52ac24a1d7969bfa007def9992110cf4c0888a
tree0410432a45a27cd67a51b6a451e4dc5cb2334555
parent8843bcb776382c913eb86c5d333dedd6e65bf971
LU-12586 lov: Correct write_intent end for trunc

When instantiating a layout, the server interprets the
write intent from the client as the range [start, end), not
including the last byte.

This is correct for writes because the last byte given for
a write is actually 'endpos', the resulting file pointer
position, and so is not included.

However, truncate is specifiying a size, not an endpos, so
truncate is [start, size].  To make this work with the
[start, end) processing for write_intents, we have to add
1 to the size when sending a write intent.

Without this, a truncate operation to the first byte of a
new layout component fails silently because the component
is not instantiated.

Lustre-change: https://review.whamcloud.com/35607
Lustre-commit: c32c7401426d46b371fa993bba17265443fefa1b

Signed-off-by: Patrick Farrell <pfarrell@whamcloud.com>
Change-Id: Id2b07abe73455bf1f0ed841ad08c5f381a871315
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Mike Pershin <mpershin@whamcloud.com>
Signed-off-by: Minh Diep <mdiep@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/35836
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/lov/lov_io.c
lustre/tests/sanity-pfl.sh