]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
kclient: fix cap delayed_work inode refcounting
authorSage Weil <sage@newdream.net>
Wed, 16 Apr 2008 14:44:51 +0000 (07:44 -0700)
committerSage Weil <sage@newdream.net>
Wed, 16 Apr 2008 14:44:51 +0000 (07:44 -0700)
src/kernel/inode.c
src/kernel/super.c

index 065815aae45a900a1db05387db0dce24a71432f5..28de8e38f8b45e6c5603ce6e98cb4f855442e291 100644 (file)
@@ -766,9 +766,8 @@ void ceph_cap_delayed_work(struct work_struct *work)
        spin_lock(&ci->vfs_inode.i_lock);
        if (ci->i_hold_caps_until > jiffies) {
                dout(-10, "cap_dwork on %p -- rescheduling\n", &ci->vfs_inode);
-               if (schedule_delayed_work(&ci->i_cap_dwork, 
-                                         ci->i_hold_caps_until - jiffies))
-                       igrab(&ci->vfs_inode);
+               schedule_delayed_work(&ci->i_cap_dwork, 
+                                     ci->i_hold_caps_until - jiffies);
                spin_unlock(&ci->vfs_inode.i_lock);
                goto out;
        }
@@ -776,7 +775,6 @@ void ceph_cap_delayed_work(struct work_struct *work)
        spin_unlock(&ci->vfs_inode.i_lock);
        ceph_check_caps(ci, 0);
 out:
-       iput(&ci->vfs_inode);
        dout(-10, "cap_dwork on %p done\n", &ci->vfs_inode);
 }
 
@@ -812,9 +810,8 @@ retry:
                if (until > ci->i_hold_caps_until) {
                        ci->i_hold_caps_until = until;
                        dout(10, "hold_caps_until %lu\n", until);
-                       if (schedule_delayed_work(&ci->i_cap_dwork, 
-                                                 until - jiffies))
-                               igrab(inode);
+                       schedule_delayed_work(&ci->i_cap_dwork, 
+                                             until - jiffies);
                }
        }
 
index 0627352302e0329faffe733883feb7d16c76cefc..379aadda961e575593fb5279278f6e5be13fa1b1 100644 (file)
@@ -164,8 +164,7 @@ static void ceph_destroy_inode(struct inode *inode)
 {
        struct ceph_inode_info *ci = ceph_inode(inode);
        dout(-30, "destroy_inode %p ino %llx\n", inode, ceph_ino(inode));
-       if (cancel_delayed_work_sync(&ci->i_cap_dwork))
-               iput(inode);
+       cancel_delayed_work_sync(&ci->i_cap_dwork);
        kfree(ci->i_symlink);
        kmem_cache_free(ceph_inode_cachep, ci);
 }