]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
kclient: only request wanted caps if they aren't already issued
authorSage Weil <sage@newdream.net>
Mon, 30 Mar 2009 20:34:58 +0000 (13:34 -0700)
committerSage Weil <sage@newdream.net>
Mon, 30 Mar 2009 20:34:58 +0000 (13:34 -0700)
We still probably want something here to avoid updating wanted on
non-auth caps.

src/kernel/caps.c
src/kernel/file.c

index 17c7ebab3b3326c0a13812d15959472d0cf242a4..d05651d4fad2fb4f7eaa39e1976607a78e0aa6d2 100644 (file)
@@ -966,7 +966,7 @@ retry_locked:
                        goto ack;
 
                /* want more caps from mds? */
-               if (want & ~cap->mds_wanted)
+               if (want & ~(cap->mds_wanted | cap->issued))
                        goto ack;
 
                if ((cap->issued & ~retain) == 0 &&
index d719233ae1e3e8339ba3ca9885407c3f07662936..d8b89f91a3eb3750188c92b031e04886f5cb71df 100644 (file)
@@ -126,8 +126,9 @@ int ceph_open(struct inode *inode, struct file *file)
                int mds_wanted = __ceph_caps_mds_wanted(ci);
                int issued = __ceph_caps_issued(ci, NULL);
 
-               dout(10, "open fmode %d caps %d using existing on %p\n",
-                    fmode, new_want, inode);
+               dout(10, "open %p fmode %d want %s issued %s using existing\n",
+                    inode, fmode, ceph_cap_string(new_want),
+                    ceph_cap_string(issued));
                __ceph_get_fmode(ci, fmode);
                spin_unlock(&inode->i_lock);