]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
kclient: free snap_rwsem at ceph_handle_snap
authorYehuda Sadeh <yehuda@hq.newdream.net>
Fri, 24 Oct 2008 17:33:24 +0000 (10:33 -0700)
committerYehuda Sadeh <yehuda@hq.newdream.net>
Fri, 24 Oct 2008 17:33:24 +0000 (10:33 -0700)
src/kernel/snap.c

index 45ef8830f3e886fd894629ec676cac7a03d71e91..6eeac091b3938009df642155abbe838a4fc520ee 100644 (file)
@@ -528,6 +528,7 @@ void ceph_handle_snap(struct ceph_mds_client *mdsc,
        int num_split_inos, num_split_realms;
        __le64 *split_inos = NULL, *split_realms = NULL;
        int i;
+       int locked_rwsem = 0;
 
        if (le32_to_cpu(msg->hdr.src.name.type) != CEPH_ENTITY_TYPE_MDS)
                return;
@@ -558,6 +559,7 @@ void ceph_handle_snap(struct ceph_mds_client *mdsc,
                dout(10, "WTF, got snap but no session for mds%d\n", mds);
                return;
        }
+       locked_rwsem = 1;
 
        mutex_lock(&session->s_mutex);
        session->s_seq++;
@@ -695,6 +697,8 @@ void ceph_handle_snap(struct ceph_mds_client *mdsc,
 bad:
        derr(10, "corrupt snap message from mds%d\n", mds);
 out:
+       if (locked_rwsem)
+               up_write(&mdsc->snap_rwsem);
        return;
 }