Whamcloud - gitweb
Fix flush-on-destroy so that it locks the same resource (i.e. the objid and
authoradilger <adilger>
Wed, 16 Jul 2003 12:58:21 +0000 (12:58 +0000)
committeradilger <adilger>
Wed, 16 Jul 2003 12:58:21 +0000 (12:58 +0000)
commit1ab0fa8e6d6a348f0569ab7093b4242a5cf352aa
tree4e4c53cdb673886f9dfc37c10640e08e8b9c0e2a
parent278a9e300e0b4e540a54bef5f447a4802c8a9109
Fix flush-on-destroy so that it locks the same resource (i.e. the objid and
not the inode number) as what the clients are locking.

Re-enable flush-on-close, because flush-on-destroy has a deadlock:
- client is writing to object (so has a write extent lock), so
  filter_brw_write() (via filter_fid2dentry()) needs a read lock on
  parent dir to do the object lookup
- client unlinks object (so gets write lock on parent) and then grabs the
  write extent lock on same object in order to flush pages

Solutions are:
- grab extent lock before parent directory lock (a bit messy, but doable)
- send file handle with writes to avoid lookup (needs some way to pass
  handle to inode, and doesn't really help us since file is now allowed
  to be closed before writing is complete)
lustre/llite/llite_lib.c