]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
libcephfs_proxy: add option to disable config copies
authorXavi Hernandez <xhernandez@gmail.com>
Tue, 13 Jan 2026 12:38:24 +0000 (13:38 +0100)
committerXavi Hernandez <xhernandez@gmail.com>
Tue, 10 Feb 2026 07:20:27 +0000 (08:20 +0100)
Signed-off-by: Xavi Hernandez <xhernandez@gmail.com>
src/libcephfs_proxy/libcephfsd.c
src/libcephfs_proxy/proxy.h
src/libcephfs_proxy/proxy_mount.c

index cb424fea65f0deb4439177e211169f1acc5e3403..396ddea5ed0ad6a1294f4e9574dca79297a958c8 100644 (file)
@@ -2327,12 +2327,13 @@ static void log_print(proxy_log_handler_t *handler, int32_t level, int32_t err,
 }
 
 static struct option main_opts[] = {
-       {"socket",   required_argument, NULL, 's'},
-       {"work-dir", required_argument, NULL, 'w'},
+       {"socket",              required_argument, NULL, 's'},
+       {"work-dir",            required_argument, NULL, 'w'},
+       {"disable-safe-config", no_argument,       NULL, 'u'},
        {}
 };
 
-static const char short_opts[] = ":s:w:";
+static const char short_opts[] = ":s:w:u";
 
 int32_t main(int32_t argc, char *argv[])
 {
@@ -2350,6 +2351,7 @@ int32_t main(int32_t argc, char *argv[])
 
        proxy.settings.socket_path = PROXY_SOCKET;
        proxy.settings.work_dir = ".";
+       proxy.settings.disable_copy = false;
 
        env = getenv(PROXY_SOCKET_ENV);
        if (env != NULL) {
@@ -2361,6 +2363,8 @@ int32_t main(int32_t argc, char *argv[])
                        proxy.settings.socket_path = optarg;
                } else if (val == 'w') {
                        proxy.settings.work_dir = optarg;
+               } else if (val == 'u') {
+                       proxy.settings.disable_copy = true;
                } else if (val == ':') {
                        proxy_log(LOG_ERR, ENODATA,
                                  "Argument missing for '%s'\n", optopt);
index e0295e4ecf3d109fa830f1ffee46d99ac5d69308..baa16008c4a1f21ed79e4c4225ec8cd3e13f5291 100644 (file)
@@ -98,6 +98,7 @@ struct _list {
 struct _proxy_settings {
        const char *socket_path;
        const char *work_dir;
+       bool disable_copy;
 };
 
 #endif
index 67f8c5882885392f306a6fe2b28d4174df2ea388..c4e40959fe6f212505c950df59102f1d3421a6eb 100644 (file)
@@ -657,6 +657,10 @@ static int32_t proxy_config_prepare(proxy_settings_t *settings,
        const char *name;
        int32_t err;
 
+       if (settings->disable_copy) {
+               return proxy_snprintf(path, size, "%s", config);
+       }
+
        cfg.size = 4096;
        cfg.buffer = proxy_malloc(cfg.size);
        if (cfg.buffer == NULL) {