]> git.proxmox.com Git - pve-storage.git/commitdiff
cifs: use empty string instead of / as default directory
authorStoiko Ivanov <s.ivanov@proxmox.com>
Tue, 21 Mar 2023 11:12:40 +0000 (12:12 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 21 Mar 2023 11:38:55 +0000 (12:38 +0100)
this keeps the mount sources consistent with previous versions
without this patch there is a small regression, which leads to the
storage not being recognized as being mounted on upgrade:
* pvestatd in older version mount the storage with out trailing /
```
//cifsstore/ISO on /mnt/pve/cifsstore type cifs...
```
* the cifs_is_mounted helper does not recognize it as being mounted
(as the source now has a / in the end)
* attempting to mount leads to
```
mount error(16): Device or resource busy
```

noticed after upgrading and having a cifs storage mounted

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
PVE/Storage/CIFSPlugin.pm

index 6e20f4baf215f2f3654def4750fe427036b4682c..e03226df756bc042d1a618a77cf763c58ccd1ace 100644 (file)
@@ -17,7 +17,7 @@ sub cifs_is_mounted : prototype($$) {
     my ($scfg, $mountdata) = @_;
 
     my ($mountpoint, $server, $share) = $scfg->@{'path', 'server', 'share'};
-    my $subdir = $scfg->{subdir} // "/";
+    my $subdir = $scfg->{subdir} // '';
 
     $server = "[$server]" if Net::IP::ip_is_ipv6($server);
     my $source = "//${server}/$share$subdir";
@@ -70,7 +70,7 @@ sub cifs_mount : prototype($$$$$) {
     my ($scfg, $storeid, $smbver, $user, $domain) = @_;
 
     my ($mountpoint, $server, $share) = $scfg->@{'path', 'server', 'share'};
-    my $subdir = $scfg->{subdir} // "/";
+    my $subdir = $scfg->{subdir} // '';
 
     $server = "[$server]" if Net::IP::ip_is_ipv6($server);
     my $source = "//${server}/$share$subdir";