From patchwork Wed Jul 14 10:05:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Venky Shankar X-Patchwork-Id: 476901 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B8510C07E9C for ; Wed, 14 Jul 2021 10:06:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9DE4160FED for ; Wed, 14 Jul 2021 10:06:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239062AbhGNKJG (ORCPT ); Wed, 14 Jul 2021 06:09:06 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:41272 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238359AbhGNKJF (ORCPT ); Wed, 14 Jul 2021 06:09:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626257174; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=S4cU/xx0zjvXuWehqCcQBwCFvuxaw5ZEbgauSSASq8w=; b=WQUn442s45YZ/k94lpX9LzWdgGtL/b9C4MEJEnD/xyI5xbv+e3rvYVSUa3EBWlj+3tfn3s cbwWUX537vBCKU1/FWiIKDLhDeLrLSzdM03XlH0eFVxqzKC0UL/J9ebjX1hcMMyYuah6rC 2uWSAb0sBkgw+2Xi4uvtgrjCq5Be6Zs= Received: from mail-pg1-f200.google.com (mail-pg1-f200.google.com [209.85.215.200]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-434-IZDCrIjjPvawQLKfTsQJhw-1; Wed, 14 Jul 2021 06:06:13 -0400 X-MC-Unique: IZDCrIjjPvawQLKfTsQJhw-1 Received: by mail-pg1-f200.google.com with SMTP id 29-20020a63105d0000b029022c245c3492so1170306pgq.17 for ; Wed, 14 Jul 2021 03:06:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=S4cU/xx0zjvXuWehqCcQBwCFvuxaw5ZEbgauSSASq8w=; b=MTCdRWhURGfO+8bE9lFLEObKD8rYhbGnNQ44jH04MW7qbrM91XUAb+bcOcSoifrvz1 Wu+Dr8GPf2XAGgltNpSjPCaDcjO3Imue1l541BHU5BF2jGO0ZLazt/COqRV/o89XoQdu GAOEkVYRMC6X500GTrUDP9Bpq5mmjbibTqgHM7munkGdk3DCaiuc6OkbZcm3P3GBQfM7 n/ZinjQhW8HGSX5BVvZazavNFSbpXcarvvUeXYDWjYPWwBCJNMvErI8m8kEW8e6zbAAc okZcDioPxSwteA1VWfHWycHb8eTog82oWI2f8qIdmM5cqkX3HkQIJFVEqxZOyihRlaSF 9zyQ== X-Gm-Message-State: AOAM533WNorU+8VzQ/dBeVmWnu4M1gDS9YFBBo1C1Y5jQb2WwsYK3mnp TnjOru4ZQmZAzaf5FKraYMnJ8uzPXa3mhhqxAOez/d3DhaVT4Xy8+NBdE20aHfOul6cm6ICqUpd Nf17yPw9tLrdpkUgRqT3o6A== X-Received: by 2002:a17:90a:9b13:: with SMTP id f19mr8976094pjp.229.1626257172006; Wed, 14 Jul 2021 03:06:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzH9nkU6HkXTT3OJIbaYYx7hvd/4Da+KMD2r8eUNPvDYW0kHbcO3v/l+SdZjfl0UjTkcjxkpQ== X-Received: by 2002:a17:90a:9b13:: with SMTP id f19mr8976079pjp.229.1626257171775; Wed, 14 Jul 2021 03:06:11 -0700 (PDT) Received: from h3ckers-pride.redhat.com ([49.207.217.185]) by smtp.gmail.com with ESMTPSA id 125sm2227030pfg.52.2021.07.14.03.06.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jul 2021 03:06:11 -0700 (PDT) From: Venky Shankar To: jlayton@redhat.com, idryomov@gmail.com, lhenriques@suse.de Cc: pdonnell@redhat.com, ceph-devel@vger.kernel.org, Venky Shankar Subject: [PATCH v4 2/5] ceph: rename parse_fsid() to ceph_parse_fsid() and export Date: Wed, 14 Jul 2021 15:35:51 +0530 Message-Id: <20210714100554.85978-3-vshankar@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210714100554.85978-1-vshankar@redhat.com> References: <20210714100554.85978-1-vshankar@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org ... as it is too generic. also, use __func__ when logging rather than hardcoding the function name. Signed-off-by: Venky Shankar --- include/linux/ceph/libceph.h | 1 + net/ceph/ceph_common.c | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/include/linux/ceph/libceph.h b/include/linux/ceph/libceph.h index e50dba429819..37ab639b5012 100644 --- a/include/linux/ceph/libceph.h +++ b/include/linux/ceph/libceph.h @@ -298,6 +298,7 @@ extern bool libceph_compatible(void *data); extern const char *ceph_msg_type_name(int type); extern int ceph_check_fsid(struct ceph_client *client, struct ceph_fsid *fsid); extern void *ceph_kvmalloc(size_t size, gfp_t flags); +extern int ceph_parse_fsid(const char *str, struct ceph_fsid *fsid); struct fs_parameter; struct fc_log; diff --git a/net/ceph/ceph_common.c b/net/ceph/ceph_common.c index 0f74ceeddf48..31cbe671121c 100644 --- a/net/ceph/ceph_common.c +++ b/net/ceph/ceph_common.c @@ -217,14 +217,14 @@ void *ceph_kvmalloc(size_t size, gfp_t flags) return p; } -static int parse_fsid(const char *str, struct ceph_fsid *fsid) +int ceph_parse_fsid(const char *str, struct ceph_fsid *fsid) { int i = 0; char tmp[3]; int err = -EINVAL; int d; - dout("parse_fsid '%s'\n", str); + dout("%s '%s'\n", __func__, str); tmp[2] = 0; while (*str && i < 16) { if (ispunct(*str)) { @@ -244,9 +244,10 @@ static int parse_fsid(const char *str, struct ceph_fsid *fsid) if (i == 16) err = 0; - dout("parse_fsid ret %d got fsid %pU\n", err, fsid); + dout("%s ret %d got fsid %pU\n", __func__, err, fsid); return err; } +EXPORT_SYMBOL(ceph_parse_fsid); /* * ceph options @@ -465,7 +466,7 @@ int ceph_parse_param(struct fs_parameter *param, struct ceph_options *opt, break; case Opt_fsid: - err = parse_fsid(param->string, &opt->fsid); + err = ceph_parse_fsid(param->string, &opt->fsid); if (err) { error_plog(&log, "Failed to parse fsid: %d", err); return err; From patchwork Wed Jul 14 10:05:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Venky Shankar X-Patchwork-Id: 476900 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DD15EC07E9A for ; Wed, 14 Jul 2021 10:06:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C52E860FF2 for ; Wed, 14 Jul 2021 10:06:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238950AbhGNKJT (ORCPT ); Wed, 14 Jul 2021 06:09:19 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:40644 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239094AbhGNKJM (ORCPT ); Wed, 14 Jul 2021 06:09:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626257180; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FBH85MVFQXPuSuMKLXbXwQPzrS8jv8/jyfkKZxsdFMM=; b=Zf1aACIF56hgjCg/SDbjPJWpPxDUzaCiMWsljHKVVy9qLYciYwnqs1dOxtMYPivaimo4nc b+58xDIrGYVKVSDTCKQ4sUbj3kt4yQbgYrpwzAlF8B67DNSuP1sbUFv7OazsVpSFzqQlHX 1vca1WBFOXoYS6z86VY5swX6xsv8tqs= Received: from mail-pf1-f200.google.com (mail-pf1-f200.google.com [209.85.210.200]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-139-Bu6VPSr7NPC9pW3_yv17wA-1; Wed, 14 Jul 2021 06:06:19 -0400 X-MC-Unique: Bu6VPSr7NPC9pW3_yv17wA-1 Received: by mail-pf1-f200.google.com with SMTP id s187-20020a625ec40000b02903288ce43fc0so1293238pfb.7 for ; Wed, 14 Jul 2021 03:06:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=FBH85MVFQXPuSuMKLXbXwQPzrS8jv8/jyfkKZxsdFMM=; b=pYJk4VUcbtnzx+Y//HJsKqDT/KK70MHLLwqlri4Cfx0vZThQ2Esji+bBV98yMIwtHw vMHITA2Ds9s8FofglenL2E7Xobn8jx2a7b08yjfNWRjs89Vw53mZUymXMiNaIGdCQt9f rNRe/6NFXC4zLyR3zktps6jqe5/SckYdfP4SVNZWwMfoz9ngXzoyKRFfYVVKRXrnO+rw aj9maL13RmMvOppsBvOfbZFk8waQiCY7n1LNmzbmAd4OcOsBXBJpSxjq9JU2GhFf7p/4 EqIpeSIz98e2XnRo3FFKi6PbCMvmGMlGC5LM/js8R5Fg04KSdsz1gvlUZRaALz/U1/pk +m/Q== X-Gm-Message-State: AOAM533cGv/zAOVPJv/lksCF3pIWC1LK6sybWM0gB5bfbbQ/MnK7XyvO 8mJ1HHUcY81+SxFJYUpos8Ykk+lr8J7k0xFmyesP69XwKqNWp9z8HanovaT+SGCxIBMNtrwX3Kb ZPSdtkoRAIsd0HP8Xst/M9Q== X-Received: by 2002:a17:90a:d596:: with SMTP id v22mr3071813pju.51.1626257178331; Wed, 14 Jul 2021 03:06:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyw4HClj6jY4VYSYzi5H++ZORrf8LZNi9GgE3n6sS4BHqI/22tblJ4MP97s3b4ikIUlI5PXrQ== X-Received: by 2002:a17:90a:d596:: with SMTP id v22mr3071795pju.51.1626257178173; Wed, 14 Jul 2021 03:06:18 -0700 (PDT) Received: from h3ckers-pride.redhat.com ([49.207.217.185]) by smtp.gmail.com with ESMTPSA id 125sm2227030pfg.52.2021.07.14.03.06.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jul 2021 03:06:17 -0700 (PDT) From: Venky Shankar To: jlayton@redhat.com, idryomov@gmail.com, lhenriques@suse.de Cc: pdonnell@redhat.com, ceph-devel@vger.kernel.org, Venky Shankar Subject: [PATCH v4 4/5] ceph: record updated mon_addr on remount Date: Wed, 14 Jul 2021 15:35:53 +0530 Message-Id: <20210714100554.85978-5-vshankar@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210714100554.85978-1-vshankar@redhat.com> References: <20210714100554.85978-1-vshankar@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org Note that the new monitors are just shown in /proc/mounts. Ceph does not (re)connect to new monitors yet. Signed-off-by: Venky Shankar --- fs/ceph/super.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/fs/ceph/super.c b/fs/ceph/super.c index d8c6168b7fcd..d3a5a3729c5b 100644 --- a/fs/ceph/super.c +++ b/fs/ceph/super.c @@ -1268,6 +1268,13 @@ static int ceph_reconfigure_fc(struct fs_context *fc) else ceph_clear_mount_opt(fsc, ASYNC_DIROPS); + if (strcmp(fsc->mount_options->mon_addr, fsopt->mon_addr)) { + kfree(fsc->mount_options->mon_addr); + fsc->mount_options->mon_addr = fsopt->mon_addr; + fsopt->mon_addr = NULL; + printk(KERN_NOTICE "ceph: monitor addresses recorded, but not used for reconnection"); + } + sync_filesystem(fc->root->d_sb); return 0; }