From 473d443874ef2facf16c66342cb70e806c05a1d5 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Wed, 5 Jul 2023 12:33:38 +0100 Subject: [PATCH] smb: fix "Statfs failed: bucket or container name is needed" when mounting Before this change, if you mounted the root of the smb then it would give an error on rclone about and periodically in the mount logs: Statfs failed: bucket or container name is needed in remote This fix makes the smb backend return empty usage in this case which will stop the errors and show the default 1P of free space. See: https://forum.rclone.org/t/error-statfs-failed-bucket-or-container-name-is-needed-in-remote/39631 --- backend/smb/smb.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/smb/smb.go b/backend/smb/smb.go index b4e953354..6f1640cf4 100644 --- a/backend/smb/smb.go +++ b/backend/smb/smb.go @@ -451,7 +451,8 @@ func (f *Fs) List(ctx context.Context, dir string) (entries fs.DirEntries, err e func (f *Fs) About(ctx context.Context) (_ *fs.Usage, err error) { share, dir := f.split("/") if share == "" { - return nil, fs.ErrorListBucketRequired + // Just return empty info rather than an error if called on the root + return &fs.Usage{}, nil } dir = f.toSambaPath(dir)