mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-15 02:05:33 +00:00
libceph: make sure redirect does not change namespace
Signed-off-by: Yan, Zheng <zyan@redhat.com> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
This commit is contained in:
parent
30c156d995
commit
cd08e0a274
@ -2608,10 +2608,23 @@ static int ceph_oloc_decode(void **p, void *end,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (struct_v >= 5) {
|
if (struct_v >= 5) {
|
||||||
|
bool changed = false;
|
||||||
|
|
||||||
len = ceph_decode_32(p);
|
len = ceph_decode_32(p);
|
||||||
if (len > 0) {
|
if (len > 0) {
|
||||||
ceph_decode_need(p, end, len, e_inval);
|
ceph_decode_need(p, end, len, e_inval);
|
||||||
|
if (!oloc->pool_ns ||
|
||||||
|
ceph_compare_string(oloc->pool_ns, *p, len))
|
||||||
|
changed = true;
|
||||||
*p += len;
|
*p += len;
|
||||||
|
} else {
|
||||||
|
if (oloc->pool_ns)
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
if (changed) {
|
||||||
|
/* redirect changes namespace */
|
||||||
|
pr_warn("ceph_object_locator::nspace is changed\n");
|
||||||
|
goto e_inval;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2820,7 +2833,9 @@ static void handle_reply(struct ceph_osd *osd, struct ceph_msg *msg)
|
|||||||
goto out_unlock_session;
|
goto out_unlock_session;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m.redirect.oloc.pool_ns = req->r_t.target_oloc.pool_ns;
|
||||||
ret = decode_MOSDOpReply(msg, &m);
|
ret = decode_MOSDOpReply(msg, &m);
|
||||||
|
m.redirect.oloc.pool_ns = NULL;
|
||||||
if (ret) {
|
if (ret) {
|
||||||
pr_err("failed to decode MOSDOpReply for tid %llu: %d\n",
|
pr_err("failed to decode MOSDOpReply for tid %llu: %d\n",
|
||||||
req->r_tid, ret);
|
req->r_tid, ret);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user