From 1ab0fa8e6d6a348f0569ab7093b4242a5cf352aa Mon Sep 17 00:00:00 2001 From: adilger Date: Wed, 16 Jul 2003 12:58:21 +0000 Subject: [PATCH] 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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lustre/llite/llite_lib.c b/lustre/llite/llite_lib.c index d2126db..ce3a9f9 100644 --- a/lustre/llite/llite_lib.c +++ b/lustre/llite/llite_lib.c @@ -611,9 +611,9 @@ int ll_setattr_raw(struct inode *inode, struct iattr *attr) rc = mdc_setattr(&sbi->ll_mdc_conn, &op_data, attr, NULL, 0, NULL, 0, &request); - if (rc) { + if (rc) { ptlrpc_req_finished(request); - if (rc != -EPERM) + if (rc != -EPERM) CERROR("mdc_setattr fails: err = %d\n", rc); RETURN(rc); } -- 1.8.3.1