]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - fs/ceph/mds_client.c
Merge branch 'x86-boot-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[mirror_ubuntu-bionic-kernel.git] / fs / ceph / mds_client.c
index 89e4305a94d4ab3923788c908ece1bd7cf9b0ae5..6aa07af67603ada211f49268d3845ea62b625720 100644 (file)
@@ -1189,6 +1189,10 @@ static int remove_session_caps_cb(struct inode *inode, struct ceph_cap *cap,
                }
                spin_unlock(&mdsc->cap_dirty_lock);
 
+               if (!ci->i_dirty_caps && ci->i_prealloc_cap_flush) {
+                       list_add(&ci->i_prealloc_cap_flush->list, &to_remove);
+                       ci->i_prealloc_cap_flush = NULL;
+               }
        }
        spin_unlock(&ci->i_ceph_lock);
        while (!list_empty(&to_remove)) {
@@ -1196,7 +1200,7 @@ static int remove_session_caps_cb(struct inode *inode, struct ceph_cap *cap,
                cf = list_first_entry(&to_remove,
                                      struct ceph_cap_flush, list);
                list_del(&cf->list);
-               kfree(cf);
+               ceph_free_cap_flush(cf);
        }
        while (drop--)
                iput(inode);
@@ -1664,7 +1668,8 @@ int ceph_alloc_readdir_reply_buffer(struct ceph_mds_request *req,
 
        order = get_order(size * num_entries);
        while (order >= 0) {
-               rinfo->dir_in = (void*)__get_free_pages(GFP_NOFS | __GFP_NOWARN,
+               rinfo->dir_in = (void*)__get_free_pages(GFP_KERNEL |
+                                                       __GFP_NOWARN,
                                                        order);
                if (rinfo->dir_in)
                        break;