]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: fix subvolume group corruption from smb share form 68066/head
authorNizamudeen A <nia@redhat.com>
Sat, 28 Mar 2026 08:20:44 +0000 (13:50 +0530)
committerNizamudeen A <nia@redhat.com>
Sat, 28 Mar 2026 08:20:44 +0000 (13:50 +0530)
the SMB share form accidentally corrupts the subvolume group when it
issues a call to the subvolume_info API with an empty subvol_name which
then corrupts the group entirely and the following subvolume creation
gets failed.

The fix is to not call subvol_info with an empty name.

Fixes: https://tracker.ceph.com/issues/75771
Signed-off-by: Nizamudeen A <nia@redhat.com>
src/pybind/mgr/dashboard/frontend/src/app/ceph/smb/smb-share-form/smb-share-form.component.ts

index 530bb654e5479e91c993199109ed87db9bb6430f..54aa17af23e3b52e9b2d7a80e69110643abbd4fa 100644 (file)
@@ -246,16 +246,21 @@ export class SmbShareFormComponent extends CdForm implements OnInit {
       const subvolGroup = this.smbShareForm.getValue('subvolume_group') || ''; // Default to empty if not present
       const subvol = this.smbShareForm.getValue('subvolume');
 
-      this.subvolService
-        .info(fsName, subvol, subvolGroup)
-        .pipe(map((data: any) => data['path']))
-        .subscribe(
-          (path: string) => {
-            this.updatePath(path);
-            resolve();
-          },
-          (error: any) => reject(error)
-        );
+      if (subvol) {
+        this.subvolService
+          .info(fsName, subvol, subvolGroup)
+          .pipe(map((data: any) => data['path']))
+          .subscribe(
+            (path: string) => {
+              this.updatePath(path);
+              resolve();
+            },
+            (error: any) => reject(error)
+          );
+      } else {
+        this.updatePath(`/volumes/${subvolGroup}/`);
+        resolve();
+      }
     });
   }