* [PATCH 0/2] ceph: use entity name from new device string
@ 2024-10-14 13:46 Patrick Donnelly
2024-10-14 13:46 ` [PATCH 1/2] ceph: requalify some char pointers as const Patrick Donnelly
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Patrick Donnelly @ 2024-10-14 13:46 UTC (permalink / raw)
To: Ilya Dryomov, Xiubo Li
Cc: Patrick Donnelly,
open list:CEPH DISTRIBUTED FILE SYSTEM CLIENT (CEPH), open list
From: Patrick Donnelly <pdonnell@redhat.com>
Respinning this because the last series accidentally included patches from
another set.
Patrick Donnelly (2):
ceph: requalify some char pointers as const
ceph: extract entity name from device id
fs/ceph/super.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
base-commit: 7234e2ea0edd00bfb6bb2159e55878c19885ce68
--
Patrick Donnelly, Ph.D.
He / Him / His
Red Hat Partner Engineer
IBM, Inc.
GPG: 19F28A586F808C2402351B93C3301A3E258DD79D
^ permalink raw reply [flat|nested] 5+ messages in thread* [PATCH 1/2] ceph: requalify some char pointers as const
2024-10-14 13:46 [PATCH 0/2] ceph: use entity name from new device string Patrick Donnelly
@ 2024-10-14 13:46 ` Patrick Donnelly
2024-10-14 13:46 ` [PATCH 2/2] ceph: extract entity name from device id Patrick Donnelly
2024-11-18 10:46 ` [PATCH 0/2] ceph: use entity name from new device string Ilya Dryomov
2 siblings, 0 replies; 5+ messages in thread
From: Patrick Donnelly @ 2024-10-14 13:46 UTC (permalink / raw)
To: Xiubo Li, Ilya Dryomov
Cc: Patrick Donnelly,
open list:CEPH DISTRIBUTED FILE SYSTEM CLIENT (CEPH), open list
From: Patrick Donnelly <pdonnell@redhat.com>
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
---
fs/ceph/super.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/ceph/super.c b/fs/ceph/super.c
index 73f321b52895..42bdbe5b7ef9 100644
--- a/fs/ceph/super.c
+++ b/fs/ceph/super.c
@@ -286,7 +286,7 @@ static int ceph_parse_new_source(const char *dev_name, const char *dev_name_end,
struct ceph_fsid fsid;
struct ceph_parse_opts_ctx *pctx = fc->fs_private;
struct ceph_mount_options *fsopt = pctx->opts;
- char *fsid_start, *fs_name_start;
+ const char *fsid_start, *fs_name_start;
if (*dev_name_end != '=') {
dout("separator '=' missing in source");
--
Patrick Donnelly, Ph.D.
He / Him / His
Red Hat Partner Engineer
IBM, Inc.
GPG: 19F28A586F808C2402351B93C3301A3E258DD79D
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH 2/2] ceph: extract entity name from device id
2024-10-14 13:46 [PATCH 0/2] ceph: use entity name from new device string Patrick Donnelly
2024-10-14 13:46 ` [PATCH 1/2] ceph: requalify some char pointers as const Patrick Donnelly
@ 2024-10-14 13:46 ` Patrick Donnelly
2024-11-18 10:46 ` [PATCH 0/2] ceph: use entity name from new device string Ilya Dryomov
2 siblings, 0 replies; 5+ messages in thread
From: Patrick Donnelly @ 2024-10-14 13:46 UTC (permalink / raw)
To: Xiubo Li, Ilya Dryomov
Cc: Patrick Donnelly, stable,
open list:CEPH DISTRIBUTED FILE SYSTEM CLIENT (CEPH), open list
From: Patrick Donnelly <pdonnell@redhat.com>
Previously, the "name" in the new device syntax "<name>@<fsid>.<fsname>" was
ignored because (presumably) tests were done using mount.ceph which also passed
the entity name using "-o name=foo". If mounting is done without the mount.ceph
helper, the new device id syntax fails to set the name properly.
Cc: stable@vger.kernel.org
Resolves: https://tracker.ceph.com/issues/68516
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
---
fs/ceph/super.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/fs/ceph/super.c b/fs/ceph/super.c
index 42bdbe5b7ef9..de03cd6eb86e 100644
--- a/fs/ceph/super.c
+++ b/fs/ceph/super.c
@@ -285,7 +285,9 @@ static int ceph_parse_new_source(const char *dev_name, const char *dev_name_end,
size_t len;
struct ceph_fsid fsid;
struct ceph_parse_opts_ctx *pctx = fc->fs_private;
+ struct ceph_options *opts = pctx->copts;
struct ceph_mount_options *fsopt = pctx->opts;
+ const char *name_start = dev_name;
const char *fsid_start, *fs_name_start;
if (*dev_name_end != '=') {
@@ -296,8 +298,14 @@ static int ceph_parse_new_source(const char *dev_name, const char *dev_name_end,
fsid_start = strchr(dev_name, '@');
if (!fsid_start)
return invalfc(fc, "missing cluster fsid");
- ++fsid_start; /* start of cluster fsid */
+ len = fsid_start - name_start;
+ kfree(opts->name);
+ opts->name = kstrndup(name_start, len, GFP_KERNEL);
+ if (!opts->name)
+ return -ENOMEM;
+ dout("using %s entity name", opts->name);
+ ++fsid_start; /* start of cluster fsid */
fs_name_start = strchr(fsid_start, '.');
if (!fs_name_start)
return invalfc(fc, "missing file system name");
--
Patrick Donnelly, Ph.D.
He / Him / His
Red Hat Partner Engineer
IBM, Inc.
GPG: 19F28A586F808C2402351B93C3301A3E258DD79D
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH 0/2] ceph: use entity name from new device string
2024-10-14 13:46 [PATCH 0/2] ceph: use entity name from new device string Patrick Donnelly
2024-10-14 13:46 ` [PATCH 1/2] ceph: requalify some char pointers as const Patrick Donnelly
2024-10-14 13:46 ` [PATCH 2/2] ceph: extract entity name from device id Patrick Donnelly
@ 2024-11-18 10:46 ` Ilya Dryomov
2 siblings, 0 replies; 5+ messages in thread
From: Ilya Dryomov @ 2024-11-18 10:46 UTC (permalink / raw)
To: Patrick Donnelly
Cc: Xiubo Li, Patrick Donnelly,
open list:CEPH DISTRIBUTED FILE SYSTEM CLIENT (CEPH), open list
On Mon, Oct 14, 2024 at 3:46 PM Patrick Donnelly <batrick@batbytes.com> wrote:
>
> From: Patrick Donnelly <pdonnell@redhat.com>
>
> Respinning this because the last series accidentally included patches from
> another set.
>
> Patrick Donnelly (2):
> ceph: requalify some char pointers as const
> ceph: extract entity name from device id
Hi Patrick,
Since the fix (the second patch) is marked for stable, I reordered
these so that the first patch which just tacks on const doesn't get in
the way when backporting the fix.
Thanks,
Ilya
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/3] ceph: correct ceph_mds_cap_item field name
@ 2024-10-13 1:16 Patrick Donnelly
2024-10-13 1:16 ` [PATCH 1/2] ceph: requalify some char pointers as const Patrick Donnelly
0 siblings, 1 reply; 5+ messages in thread
From: Patrick Donnelly @ 2024-10-13 1:16 UTC (permalink / raw)
To: Xiubo Li, Ilya Dryomov
Cc: Patrick Donnelly, Patrick Donnelly, ceph-devel, linux-kernel
The issue_seq is sent with bulk cap releases, not the current sequence number.
See also ceph.git commit: "include/ceph_fs: correct ceph_mds_cap_item field name".
See-also: https://tracker.ceph.com/issues/66704
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
---
fs/ceph/mds_client.c | 2 +-
include/linux/ceph/ceph_fs.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
index c4a5fd94bbbb..0be82de8a6da 100644
--- a/fs/ceph/mds_client.c
+++ b/fs/ceph/mds_client.c
@@ -2362,7 +2362,7 @@ static void ceph_send_cap_releases(struct ceph_mds_client *mdsc,
item->ino = cpu_to_le64(cap->cap_ino);
item->cap_id = cpu_to_le64(cap->cap_id);
item->migrate_seq = cpu_to_le32(cap->mseq);
- item->seq = cpu_to_le32(cap->issue_seq);
+ item->issue_seq = cpu_to_le32(cap->issue_seq);
msg->front.iov_len += sizeof(*item);
ceph_put_cap(mdsc, cap);
diff --git a/include/linux/ceph/ceph_fs.h b/include/linux/ceph/ceph_fs.h
index ee1d0e5f9789..4ff3ad5e9210 100644
--- a/include/linux/ceph/ceph_fs.h
+++ b/include/linux/ceph/ceph_fs.h
@@ -822,7 +822,7 @@ struct ceph_mds_cap_release {
struct ceph_mds_cap_item {
__le64 ino;
__le64 cap_id;
- __le32 migrate_seq, seq;
+ __le32 migrate_seq, issue_seq;
} __attribute__ ((packed));
#define CEPH_MDS_LEASE_REVOKE 1 /* mds -> client */
base-commit: 75b607fab38d149f232f01eae5e6392b394dd659
--
Patrick Donnelly, Ph.D.
He / Him / His
Red Hat Partner Engineer
IBM, Inc.
GPG: 19F28A586F808C2402351B93C3301A3E258DD79D
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH 1/2] ceph: requalify some char pointers as const
2024-10-13 1:16 [PATCH 1/3] ceph: correct ceph_mds_cap_item field name Patrick Donnelly
@ 2024-10-13 1:16 ` Patrick Donnelly
0 siblings, 0 replies; 5+ messages in thread
From: Patrick Donnelly @ 2024-10-13 1:16 UTC (permalink / raw)
To: Xiubo Li, Ilya Dryomov; +Cc: Patrick Donnelly, ceph-devel, linux-kernel
From: Patrick Donnelly <pdonnell@redhat.com>
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
---
fs/ceph/super.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/ceph/super.c b/fs/ceph/super.c
index 73f321b52895..42bdbe5b7ef9 100644
--- a/fs/ceph/super.c
+++ b/fs/ceph/super.c
@@ -286,7 +286,7 @@ static int ceph_parse_new_source(const char *dev_name, const char *dev_name_end,
struct ceph_fsid fsid;
struct ceph_parse_opts_ctx *pctx = fc->fs_private;
struct ceph_mount_options *fsopt = pctx->opts;
- char *fsid_start, *fs_name_start;
+ const char *fsid_start, *fs_name_start;
if (*dev_name_end != '=') {
dout("separator '=' missing in source");
base-commit: 7234e2ea0edd00bfb6bb2159e55878c19885ce68
--
Patrick Donnelly, Ph.D.
He / Him / His
Red Hat Partner Engineer
IBM, Inc.
GPG: 19F28A586F808C2402351B93C3301A3E258DD79D
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-11-18 10:46 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-14 13:46 [PATCH 0/2] ceph: use entity name from new device string Patrick Donnelly
2024-10-14 13:46 ` [PATCH 1/2] ceph: requalify some char pointers as const Patrick Donnelly
2024-10-14 13:46 ` [PATCH 2/2] ceph: extract entity name from device id Patrick Donnelly
2024-11-18 10:46 ` [PATCH 0/2] ceph: use entity name from new device string Ilya Dryomov
-- strict thread matches above, loose matches on Subject: below --
2024-10-13 1:16 [PATCH 1/3] ceph: correct ceph_mds_cap_item field name Patrick Donnelly
2024-10-13 1:16 ` [PATCH 1/2] ceph: requalify some char pointers as const Patrick Donnelly
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox