Whamcloud - gitweb
LU-15779 ofd: don't hold read lock over bulk 25/47825/3
authorAlex Zhuravlev <bzzz@whamcloud.com>
Tue, 28 Jun 2022 22:05:33 +0000 (15:05 -0700)
committerOleg Drokin <green@whamcloud.com>
Sat, 20 Aug 2022 16:13:48 +0000 (16:13 +0000)
commit28875487ab3c94015fdd1c6b32c3ee63bdf81965
treee6c5fc888d1a74c84513b2e20b7c86ee3560ae22
parent2d50865d2457ee4570aa4a5829c2e87ea69dd4c0
LU-15779 ofd: don't hold read lock over bulk

as this can block all operations on OST:

1) ofd_preprw_read() takes a shared object lock and initiates BULK
2) OUT needs an exclusive object lock on the same object
3) ofd_commitrw_write() starts transaction and now has to wait
   for OUT to get and release that exclusive object lock (step 2)
4) number of threads can get stuck waiting for ofd_commit_write()
   to stop it's transaction

this patch drops a shared object lock before BULK transfer.
at the moment it's not clear how such read would race with
object removal on ZFS - this should be investigated.

Lustre-change: https://review.whamcloud.com/47126
Lustre-commit: 98ba50819024b908453b62fd095647442929a61f

Signed-off-by: Alex Zhuravlev <bzzz@whamcloud.com>
Change-Id: I131493abd90283e9ca897f904e00c25d26e3d8d3
Reviewed-on: https://review.whamcloud.com/47825
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/ofd/ofd_io.c