Whamcloud - gitweb
b=2334
authorphil <phil>
Fri, 5 Dec 2003 15:18:18 +0000 (15:18 +0000)
committerphil <phil>
Fri, 5 Dec 2003 15:18:18 +0000 (15:18 +0000)
Break cyclic locking deadlock by dropping the MDC read lock before we
take the OSC read lock during getattr intents

lustre/ChangeLog
lustre/llite/dcache.c
lustre/llite/llite_lib.c

index 08d2243..7907f6e 100644 (file)
@@ -22,6 +22,7 @@ tbd         Cluster File Systems, Inc. <info@clusterfs.com>
        - better error messages when a client is rejected during recovery (1505)
        - avoid cancelling locks which were never granted, after failure (2330)
        - fix i_sem/journal inversion in mds_client_add (2333)
+       - fix truncate/getattr lock cycle deadlock (2334)
        * miscellania
        - allow configurable automake binary, for testing new versions
        - small update to the lfs documentation
index 9dba881..d82b47b 100644 (file)
@@ -157,8 +157,8 @@ void ll_lookup_finish_locks(struct lookup_intent *it, struct dentry *dentry)
                 mdc_set_lock_data(&it->d.lustre.it_lock_handle, inode);
         }
 
-        /* drop IT_LOOKUP locks */
-        if (it->it_op == IT_LOOKUP)
+        /* drop lookup or getattr locks immediately */
+        if (it->it_op == IT_LOOKUP || it->it_op == IT_GETATTR)
                 ll_intent_release(it);
 }
 
index d093a93..bba3a0c 100644 (file)
@@ -1076,21 +1076,21 @@ void ll_read_inode2(struct inode *inode, void *opaque)
         } else {
                 inode->i_op = &ll_special_inode_operations;
 #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
-                init_special_inode(inode, inode->i_mode, 
+                init_special_inode(inode, inode->i_mode,
                                    kdev_t_to_nr(inode->i_rdev));
 #else
                 init_special_inode(inode, inode->i_mode, inode->i_rdev);
-                
+
                 lli->ll_save_ifop = inode->i_fop;
                 if (S_ISCHR(inode->i_mode)) {
-                        inode->i_fop = &ll_special_chr_inode_fops;                                                         
-                }else if (S_ISBLK(inode->i_mode)) {
-                        inode->i_fop = &ll_special_blk_inode_fops; 
-                }else if (S_ISFIFO(inode->i_mode)){
+                        inode->i_fop = &ll_special_chr_inode_fops;
+                } else if (S_ISBLK(inode->i_mode)) {
+                        inode->i_fop = &ll_special_blk_inode_fops;
+                } else if (S_ISFIFO(inode->i_mode)) {
                         inode->i_fop = &ll_special_fifo_inode_fops;
-                }else if (S_ISSOCK(inode->i_mode)){ 
+                } else if (S_ISSOCK(inode->i_mode)) {
                         inode->i_fop = &ll_special_sock_inode_fops;
-                }                                               
+                }
                 inode->i_fop->owner = lli->ll_save_ifop->owner;
 #endif
                 EXIT;
@@ -1098,7 +1098,7 @@ void ll_read_inode2(struct inode *inode, void *opaque)
 }
 
 int ll_iocontrol(struct inode *inode, struct file *file,
-                        unsigned int cmd, unsigned long arg)
+                 unsigned int cmd, unsigned long arg)
 {
         struct ll_sb_info *sbi = ll_i2sbi(inode);
         struct ptlrpc_request *req = NULL;