All of lore.kernel.org
 help / color / mirror / Atom feed
* Patch "libceph: fix legacy layout decode with pool 0" has been added to the 4.8-stable tree
@ 2016-11-17  9:05 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2016-11-17  9:05 UTC (permalink / raw)
  To: zyan, gregkh, idryomov; +Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    libceph: fix legacy layout decode with pool 0

to the 4.8-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     libceph-fix-legacy-layout-decode-with-pool-0.patch
and it can be found in the queue-4.8 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From 3890dce1d3a8b9fe3bc36de99496792e468cd079 Mon Sep 17 00:00:00 2001
From: "Yan, Zheng" <zyan@redhat.com>
Date: Wed, 9 Nov 2016 16:42:48 +0800
Subject: libceph: fix legacy layout decode with pool 0

From: Yan, Zheng <zyan@redhat.com>

commit 3890dce1d3a8b9fe3bc36de99496792e468cd079 upstream.

If your data pool was pool 0, ceph_file_layout_from_legacy()
transform that to -1 unconditionally, which broke upgrades.
We only want do that for a fully zeroed ceph_file_layout,
so that it still maps to a file_layout_t.  If any fields
are set, though, we trust the fl_pgpool to be a valid pool.

Fixes: 7627151ea30bc ("libceph: define new ceph_file_layout structure")
Link: http://tracker.ceph.com/issues/17825
Signed-off-by: Yan, Zheng <zyan@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 net/ceph/ceph_fs.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/net/ceph/ceph_fs.c
+++ b/net/ceph/ceph_fs.c
@@ -34,7 +34,8 @@ void ceph_file_layout_from_legacy(struct
 	fl->stripe_count = le32_to_cpu(legacy->fl_stripe_count);
 	fl->object_size = le32_to_cpu(legacy->fl_object_size);
 	fl->pool_id = le32_to_cpu(legacy->fl_pg_pool);
-	if (fl->pool_id == 0)
+	if (fl->pool_id == 0 && fl->stripe_unit == 0 &&
+	    fl->stripe_count == 0 && fl->object_size == 0)
 		fl->pool_id = -1;
 }
 EXPORT_SYMBOL(ceph_file_layout_from_legacy);


Patches currently in stable-queue which might be from zyan@redhat.com are

queue-4.8/libceph-fix-legacy-layout-decode-with-pool-0.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-11-17  9:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-17  9:05 Patch "libceph: fix legacy layout decode with pool 0" has been added to the 4.8-stable tree gregkh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.