Whamcloud - gitweb
LU-12593 osd: zeroing a freshly allocated block buffer 09/36709/2
authorAlexander Boyko <c17825@cray.com>
Fri, 26 Jul 2019 14:13:21 +0000 (10:13 -0400)
committerOleg Drokin <green@whamcloud.com>
Thu, 5 Dec 2019 14:56:52 +0000 (14:56 +0000)
commite196376e841113c47423639b0f5f09f46cdfa25c
tree031070a6e768c195d3b66baeb8da19095bd1d602
parent173696c3252aea3ec5da5aef00252c1378f98b5e
LU-12593 osd: zeroing a freshly allocated block buffer

Ldiskfs zeroes new buffer only when it is not uptodate.
In rare case we can get a new buffer head with uptodate flag.
This may cause a file corruption for non zero offset writes,
especially for internal Lustre files like update_log, CATALOGS,
lov_objid.

od_fld_lookup()) lustre-MDT0001-mdtlov: invalid FID [0x0:0x50:0x0]

The patch adds zeroing under i_mutex for unmaped blocks.

The performance results, since the patch adds mutex to a creation
path (lov_objid file).
40 tasks, 2000000 files
SUMMARY: (of 5 iterations)
Operation       Max           Min           Mean    Std Dev
---------       ---           ---           ----    -------
without fix
File creation: 39990.601   19020.238     27443.823  6909.605
With fix
File creation: 37958.809   21708.187     27065.855  5900.961

Lustre-change: https://review.whamcloud.com/35629
Lustre-commit: f832a7dc33c69fae9af199f0317e6385deeaeccf

Cray-bug-id: LUS-6132
Signed-off-by: Alexander Boyko <c17825@cray.com>
Change-Id: Ica8fbe29b5a7253d553b41a41ffe5d8d8b4b2e55
Reviewed-by: Shaun Tancheff <stancheff@cray.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Signed-off-by: Minh Diep <mdiep@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/36709
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/osd-ldiskfs/osd_io.c