From 9aa714e659e55eb92ffa23929c965ae1338d85e5 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 e3fa0e666..307f9b5d9 100644 --- a/backend/smb/smb.go +++ b/backend/smb/smb.go @@ -447,7 +447,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)