]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - fs/ceph/addr.c
libceph: Unlock unprocessed pages in start_read() error path
[karo-tx-linux.git] / fs / ceph / addr.c
index 6690269f5dde2c5617cff3238167788f93636985..d7293d6d1176ef46744f409e689879d96a462cc2 100644 (file)
@@ -267,6 +267,14 @@ static void finish_read(struct ceph_osd_request *req, struct ceph_msg *msg)
        kfree(req->r_pages);
 }
 
+static void ceph_unlock_page_vector(struct page **pages, int num_pages)
+{
+       int i;
+
+       for (i = 0; i < num_pages; i++)
+               unlock_page(pages[i]);
+}
+
 /*
  * start an async read(ahead) operation.  return nr_pages we submitted
  * a read for on success, or negative error code.
@@ -347,6 +355,7 @@ static int start_read(struct inode *inode, struct list_head *page_list, int max)
        return nr_pages;
 
 out_pages:
+       ceph_unlock_page_vector(pages, nr_pages);
        ceph_release_page_vector(pages, nr_pages);
 out:
        ceph_osdc_put_request(req);