[3.11.y.z extended stable] Patch "ceph: Add check returned value on func ceph_calc_ceph_pg." has been added to staging queue

Luis Henriques luis.henriques at canonical.com
Thu Jan 9 12:04:56 UTC 2014


This is a note to let you know that I have just added a patch titled

    ceph: Add check returned value on func ceph_calc_ceph_pg.

to the linux-3.11.y-queue branch of the 3.11.y.z extended stable tree 
which can be found at:

 http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.11.y-queue

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.11.y.z tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable

Thanks.
-Luis

------

>From ac0993b347e2cf5213866ac5be8f6b30d86f030d Mon Sep 17 00:00:00 2001
From: majianpeng <majianpeng at gmail.com>
Date: Fri, 2 Aug 2013 18:14:48 +0800
Subject: ceph: Add check returned value on func ceph_calc_ceph_pg.

commit 2fbcbff1d6b9243ef71c64a8ab993bc3c7bb7af1 upstream.

Func ceph_calc_ceph_pg maybe failed.So add check for returned value.

Signed-off-by: Jianpeng Ma <majianpeng at gmail.com>
Reviewed-by: Sage Weil <sage at inktank.com>
Signed-off-by: Sage Weil <sage at inktank.com>
Signed-off-by: Luis Henriques <luis.henriques at canonical.com>
---
 fs/ceph/ioctl.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/fs/ceph/ioctl.c b/fs/ceph/ioctl.c
index a5ce62e..669622f 100644
--- a/fs/ceph/ioctl.c
+++ b/fs/ceph/ioctl.c
@@ -211,8 +211,12 @@ static long ceph_ioctl_get_dataloc(struct file *file, void __user *arg)
 	snprintf(dl.object_name, sizeof(dl.object_name), "%llx.%08llx",
 		 ceph_ino(inode), dl.object_no);

-	ceph_calc_ceph_pg(&pgid, dl.object_name, osdc->osdmap,
-		ceph_file_layout_pg_pool(ci->i_layout));
+	r = ceph_calc_ceph_pg(&pgid, dl.object_name, osdc->osdmap,
+				ceph_file_layout_pg_pool(ci->i_layout));
+	if (r < 0) {
+		up_read(&osdc->map_sem);
+		return r;
+	}

 	dl.osd = ceph_calc_pg_primary(osdc->osdmap, pgid);
 	if (dl.osd >= 0) {
--
1.8.3.2





More information about the kernel-team mailing list