Whamcloud - gitweb
LU-2129 llog: protect llog write against concurrent read
authorMikhail Pershin <tappro@whamcloud.com>
Thu, 18 Oct 2012 19:01:49 +0000 (23:01 +0400)
committerOleg Drokin <green@whamcloud.com>
Mon, 19 Nov 2012 17:39:51 +0000 (12:39 -0500)
commit6c37a25e0084143a2c5e00f765a084306df90167
tree5c9411aa3a5d861a2652a023c62899652c06776c
parent613d237e4c65a5a863a641e6e87418d251f4a493
LU-2129 llog: protect llog write against concurrent read

llog_write_rec contains case when buffer passed separately from
header and tail, resulting 3 writes instead of single one, so
concurrent read may read partial record.
Another similar case is llog_pad, which writes header and tail
with required gap to align records at the end of 8K buffer.

Use dt_read/write locks on llog object to protect writes against
read. Such '3-writes' case happens only with configs llogs.

Signed-off-by: Mikhail Pershin <tappro@whamcloud.com>
Change-Id: Idfb94706b2cf8ad22776c1a277b862863f94c2f6
Reviewed-on: http://review.whamcloud.com/4303
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
lustre/obdclass/llog_osd.c