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)
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

index d2126db..ce3a9f9 100644 (file)
@@ -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);
                 }