From nobody Wed Nov 27 02:30:18 2024 Received: from mail-qv1-f42.google.com (mail-qv1-f42.google.com [209.85.219.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 32C7A1DFEF for ; Mon, 14 Oct 2024 13:46:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728913595; cv=none; b=lh45ds8yKSNjBcsfROuk3s9jEuBRWnFDtkMXzYzsa2aXOylIz/jBCM1XpYV6F5xGAXRBsnTtpzr1/CT+43+1Tt5G6rFAPBmtREKUKSdvJ0Uj0YHcAghUeOl4nnM+SfJdO4k4qRiF87rOongj4S371cZj57DiQ/nDZ4LCuCiYXH4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728913595; c=relaxed/simple; bh=vA7gQ4QlD4+heVbKXE77HzaXG+U08fb6uLAkt7Vn3Z0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DgTJk585JzO1y+8SDAfSd1MvfNX2Gt4N9pCMK3+p3Tn7SrOUhXW8UgT1n3EOhE4sWJ78Lu+84uji5R09G7sxV0FaV4U8dwFndsgd9I42m8kbY/PqQGmOxt94HE8Gutm9/vzMgwJ6NQf/jPGJthwCegWIYhbFzYEI2qvgFf+aw60= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=batbytes.com; spf=none smtp.mailfrom=batbytes.com; dkim=pass (2048-bit key) header.d=batbytes-com.20230601.gappssmtp.com header.i=@batbytes-com.20230601.gappssmtp.com header.b=DjYDxTRx; arc=none smtp.client-ip=209.85.219.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=batbytes.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=batbytes.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=batbytes-com.20230601.gappssmtp.com header.i=@batbytes-com.20230601.gappssmtp.com header.b="DjYDxTRx" Received: by mail-qv1-f42.google.com with SMTP id 6a1803df08f44-6cbf347dc66so19318946d6.3 for ; Mon, 14 Oct 2024 06:46:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=batbytes-com.20230601.gappssmtp.com; s=20230601; t=1728913592; x=1729518392; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=0BDbkRqRkZ58RWGTUQtyX05fcLDqJrW9w2cIMEG6OCY=; b=DjYDxTRx8m00gJWRzTN+Rhe/kkqWQkKykQYUS0a5BrfBpVMA0O/BdU6OU4qSfCxuAs 24x1BqfOc4RxI11XCFCW+3qcglW6ANtNWXuylsxAXfqwK09Tz8pOu4xypGntYYXWyZde ntj6AQ0D7AkKSVIiic3RCB1tgSAeF4S9d1gt50wEQkTuw7NsRaFHbukHttshgsMBuYgb fqCz6HZXWebMgKkrRpgTnacy8KvRarS3FTnNmOHiHACNhIkxlvhX2Ka/2WiokLNCeBGG ndzU68LIaFaF8zwVoPUl4E5NwqEHTKkT1lWKRRlty1AFOyAqvH1HCQWh5IZR6z4oShbt XO3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728913592; x=1729518392; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0BDbkRqRkZ58RWGTUQtyX05fcLDqJrW9w2cIMEG6OCY=; b=p8Jxpyi0GebrXvL0kzvVHiUVJNHxxCjPIqHXR04JOOvyM/hU18qc1G2jaeAEC6NvWj BljIjKRcH//TWMiMgrHB2CVP+kTD1jRuEB38MubHIRkJbgz8atFDMD/n8qMKENtxQpn5 6OQEyw4BeGLhComR9+IIOAyhQtPEs+t07ntDUGEfdt2FuuPxNsX6MNvzrmO9mdY+3eTW qAHumReRQrg7AIKhcwnlce8+Rv4uMF7QukPuCHyuBELkxd+ZketoSYctiiEOizLVXQYA OUIm5Qc+rL7blA4DMICJtaDM9zNMxd1itiVih09sE365xIwc0tL3qfGjcKYtYYyJcxME 3Ayw== X-Forwarded-Encrypted: i=1; AJvYcCUtf3Tg76piS6zO7HWyfNJuYvCeBv+P9P+HHwBuBJt/MAWI3BWWOmL0+Q2mPuGnC8whQKSZgUgrAsDmP7Q=@vger.kernel.org X-Gm-Message-State: AOJu0YxJc9HsafuCstJFObi7TAjtbJsL+1rjwqZXaYkwP5hxrjzb7i5C datL+HI+ZEkWGPvrpBZpxET6wmOh6ZBuGptjHzWqBqvmjJr/dOZlGHT1i4d6yA== X-Google-Smtp-Source: AGHT+IEGCA21dHb5ZzF4Xh/HRGRpD5nKJtwOP87LWxQeHszz39wKm/idCKHUJWwBDMxS2aVbxac2GQ== X-Received: by 2002:a05:6214:2c06:b0:6cb:e603:1c3a with SMTP id 6a1803df08f44-6cbf9d43c48mr113730346d6.25.1728913592130; Mon, 14 Oct 2024 06:46:32 -0700 (PDT) Received: from batbytes.com ([216.212.123.7]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6cbe85a7700sm45584966d6.7.2024.10.14.06.46.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Oct 2024 06:46:31 -0700 (PDT) From: Patrick Donnelly To: Xiubo Li , Ilya Dryomov Cc: Patrick Donnelly , ceph-devel@vger.kernel.org (open list:CEPH DISTRIBUTED FILE SYSTEM CLIENT (CEPH)), linux-kernel@vger.kernel.org (open list) Subject: [PATCH 1/2] ceph: requalify some char pointers as const Date: Mon, 14 Oct 2024 09:46:23 -0400 Message-ID: <20241014134625.700634-2-batrick@batbytes.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241014134625.700634-1-batrick@batbytes.com> References: <20241014134625.700634-1-batrick@batbytes.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Patrick Donnelly Signed-off-by: Patrick Donnelly --- 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 =3D fc->fs_private; struct ceph_mount_options *fsopt =3D pctx->opts; - char *fsid_start, *fs_name_start; + const char *fsid_start, *fs_name_start; =20 if (*dev_name_end !=3D '=3D') { dout("separator '=3D' missing in source"); --=20 Patrick Donnelly, Ph.D. He / Him / His Red Hat Partner Engineer IBM, Inc. GPG: 19F28A586F808C2402351B93C3301A3E258DD79D From nobody Wed Nov 27 02:30:18 2024 Received: from mail-qv1-f54.google.com (mail-qv1-f54.google.com [209.85.219.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D46621AA790 for ; Mon, 14 Oct 2024 13:46:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728913596; cv=none; b=cXTKS3MKVKG6s6+PUJfIzaXS2kSvLJIU+4IipTrlNySrcH7l62VPZjyp5d5OG7TRyvtdox+ZGQfQT+Cu6b1aGx7Q73PgaKN/E5y9MudvAYG1nWM8fl7tKaAth0qTtO+v7cuNtdMvEVJgzeZubVk1vycK9xp21E5EkTbPrOXxo3Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728913596; c=relaxed/simple; bh=hXB/C5cfukY2a2WKHkPhfQHVJ+hWk/5yyFbXvCtVRjs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=egeDj5NPsUESDf/JnY8Rgi8zi7CHCu0WYOLYJYUucGAmh4GXjqrH/8c8u5y3cioh7FK52l78pYtZR90uextxMGboDxNBw6Hh78VLQCAWipQBub6Cz7QpbmlE9Tk+uskG6aay1/OD2rOQTaqX9fp0V+5J9FfHvOW1FAKkgV9Ym6w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=batbytes.com; spf=none smtp.mailfrom=batbytes.com; dkim=pass (2048-bit key) header.d=batbytes-com.20230601.gappssmtp.com header.i=@batbytes-com.20230601.gappssmtp.com header.b=xHeT880M; arc=none smtp.client-ip=209.85.219.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=batbytes.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=batbytes.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=batbytes-com.20230601.gappssmtp.com header.i=@batbytes-com.20230601.gappssmtp.com header.b="xHeT880M" Received: by mail-qv1-f54.google.com with SMTP id 6a1803df08f44-6cbceb321b3so35413376d6.3 for ; Mon, 14 Oct 2024 06:46:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=batbytes-com.20230601.gappssmtp.com; s=20230601; t=1728913594; x=1729518394; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Ko3jW5Cl6F4biBXzgYlOkyez2QUIpC8KdqLdRC76G2Y=; b=xHeT880MBBsaME/gWtr+dHzxQSon9R0Q4Sagpqd9+n46QcZ2fTpQI8e3t6OQYZUgMl /ENN753Wihv+im2VWMdYnDnoCm/OKMC37NKFPkIBlbaaKL+saTzXvKvVvQHj+Z45hHHd 2gyHxzIFId7Ury/CiB4kmQHe3UNWOv70NUCSh4vJ9mPxXJqfIdT7lX0GgIpfclpI7HRD t3UEv0NEcPIooZ5Dhdf3GQRwY73fiPBCojMNAFJeyuRk5M6L1O0Bsqo1qmJPok3ppONl MMgBQHm4Zwbb4wvya8eha5OMzZXCYkvcKAYn+9eXjPQ+uYMegk5Cxa5KAvX0heZrl2MG S+Eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728913594; x=1729518394; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Ko3jW5Cl6F4biBXzgYlOkyez2QUIpC8KdqLdRC76G2Y=; b=Y4+NPBlcahwy821J0NRASVGwzeBrWyVbuMZNzfKFuE3kGhk92m0c3QmhUgzmDcJSeX D+YSneWB0n5Htdxt9pNbP18kYEs8zMbX0Xl7XnnQPn9Ee1/pJfr80dpBDx7NDdSuMZsd k4m3AXOQuIVnU07AoNnyBWS7rTMrZ1OfWb3iVNRhrX7iEbXJ0fd1OhpWyHOQsE7gI5dE wwoHmfw2K13iJBSKiRUuJ0+zc+FehLK1WXq1OWthGBQq4lWRGpCr4jx63oFimnrTXM3v 29OUYYlQbpagIwi+Z2tfiqxQVRTCvQqUTCMvdEJnlIKgtMbBdarheUw51BHRQQCHFPay HRyw== X-Forwarded-Encrypted: i=1; AJvYcCVY5xYXFq+Sivep7V3wL/U1h84ucXAuPgOcCj0CWxDqr4FLrdsVBJimCnPm/sBogmnH7/b+LG/TfHXccWI=@vger.kernel.org X-Gm-Message-State: AOJu0YytodUZuvCNhdXaEy+npjovo8Ljlp5jZEE6ApfIvFcKh5Mrb5VU 0HrVyhee92em6PPLXAqZAdLr08wFuHN89VpTAkdqpeTsCqB5kXOkDEdjdQjyaA== X-Google-Smtp-Source: AGHT+IECjyFa7lqpkKz9WnA88loVkpaciMaBusV2OtD0lFCtirhYVtvs6EezQ5JzX+waow9Y789YcQ== X-Received: by 2002:a05:6214:4b04:b0:6cb:eea5:69e0 with SMTP id 6a1803df08f44-6cbeff63b34mr210563056d6.27.1728913593824; Mon, 14 Oct 2024 06:46:33 -0700 (PDT) Received: from batbytes.com ([216.212.123.7]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6cbe85a7700sm45584966d6.7.2024.10.14.06.46.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Oct 2024 06:46:33 -0700 (PDT) From: Patrick Donnelly To: Xiubo Li , Ilya Dryomov Cc: Patrick Donnelly , stable@vger.kernel.org, ceph-devel@vger.kernel.org (open list:CEPH DISTRIBUTED FILE SYSTEM CLIENT (CEPH)), linux-kernel@vger.kernel.org (open list) Subject: [PATCH 2/2] ceph: extract entity name from device id Date: Mon, 14 Oct 2024 09:46:24 -0400 Message-ID: <20241014134625.700634-3-batrick@batbytes.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241014134625.700634-1-batrick@batbytes.com> References: <20241014134625.700634-1-batrick@batbytes.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Patrick Donnelly Previously, the "name" in the new device syntax "@." was ignored because (presumably) tests were done using mount.ceph which also pa= ssed the entity name using "-o name=3Dfoo". If mounting is done without the moun= t.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 --- 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 =3D fc->fs_private; + struct ceph_options *opts =3D pctx->copts; struct ceph_mount_options *fsopt =3D pctx->opts; + const char *name_start =3D dev_name; const char *fsid_start, *fs_name_start; =20 if (*dev_name_end !=3D '=3D') { @@ -296,8 +298,14 @@ static int ceph_parse_new_source(const char *dev_name,= const char *dev_name_end, fsid_start =3D strchr(dev_name, '@'); if (!fsid_start) return invalfc(fc, "missing cluster fsid"); - ++fsid_start; /* start of cluster fsid */ + len =3D fsid_start - name_start; + kfree(opts->name); + opts->name =3D kstrndup(name_start, len, GFP_KERNEL); + if (!opts->name) + return -ENOMEM; + dout("using %s entity name", opts->name); =20 + ++fsid_start; /* start of cluster fsid */ fs_name_start =3D strchr(fsid_start, '.'); if (!fs_name_start) return invalfc(fc, "missing file system name"); --=20 Patrick Donnelly, Ph.D. He / Him / His Red Hat Partner Engineer IBM, Inc. GPG: 19F28A586F808C2402351B93C3301A3E258DD79D