Whamcloud - gitweb
LU-16465 llite: fix LSOM blocks for ftruncate and close
authorEtienne AUJAMES <etienne.aujames@cea.fr>
Wed, 18 Jan 2023 09:42:54 +0000 (10:42 +0100)
committerAndreas Dilger <adilger@whamcloud.com>
Tue, 25 Apr 2023 03:36:10 +0000 (03:36 +0000)
commit39349f380fb2a8487d2ab076cde0dd86b4b85f77
tree2c1c3206e61aca31173d91070db24b095a4ca9b8
parent45497359f1cf5b97c6a05728845de224fcf2c193
LU-16465 llite: fix LSOM blocks for ftruncate and close

LSOM is updated on close and setattr request.
For the setattr, clients do not know the numbers blocks yet (OSTs
setattr requests have to finish). So the blocks number is set to 1 by
the server.

The close request send after a ftruncate() will wrongly update LSOM
back to its old blocks number. This is because clients do not update
the inode.i_blocks after an OST setattr.

Then the MDS will denied a client close request to update LSOM to its
correct blocks number. Only truncates are allowed to decrease the
blocks number (server side).

This patch force the client inode update at the end of an OST setattr.
And it tries (if no contention on the inode_size) to update the inode
at the end of an OST fsync or a sync IO.

Update sanity test 806/807 for this use case.

Lustre-change: https://review.whamcloud.com/49675
Lustre-commit: dfb08bbf77a1362f79c3738cc3952f8db2e46511

Test-Parameters: testlist=sanity env=ONLY=806,807,ONLY_REPEAT=20
Test-Parameters: fstype=zfs testlist=sanity-flr env=ONLY=70,ONLY_REPEAT=10
Signed-off-by: Etienne AUJAMES <eaujames@ddn.com>
Signed-off-by: Xing Huang <hxing@ddn.com>
Change-Id: Ib1afde97071ebae56f0b413ec444403c3cdebd02
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Qian Yingjin <qian@ddn.com>
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/50611
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lustre/llite/file.c
lustre/llite/llite_internal.h
lustre/llite/llite_lib.c
lustre/llite/vvp_io.c
lustre/tests/sanity.sh