Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ksmbd detect disk space incorrect #400

Open
ptpt52 opened this issue May 6, 2022 · 5 comments
Open

ksmbd detect disk space incorrect #400

ptpt52 opened this issue May 6, 2022 · 5 comments

Comments

@ptpt52
Copy link

ptpt52 commented May 6, 2022

step to produce the issue:

mkdir /mnt
# mount tmpfs with size limit on 1MB on /mnt
mount -o size=1M -t tmpfs tmpfs /mnt

mkdir /mnt/sda4
mount -t ext4 /dev/sda4 /mnt/sda4
chmod 777 /mnt/sda4

smb config:

[mnt]
	path = /mnt
	create mask = 0666
	directory mask = 0777
	read only = no
	guest ok = yes

disk part sda4 size is 64GB
and then
I open \\192.168.16.1\mnt in windows 11
copy one 1GB-big-file to \\192.168.16.1\mnt\sda4\

then it displays no space enough error.

@namjaejeon
Copy link
Owner

Windows is checking disk space before writing file. but mount point is tmpfs(1MB size), not ext4(64GB).
Same error will happen with samba server. Are there any other smb servers that don't have this problem?

@ptpt52
Copy link
Author

ptpt52 commented May 7, 2022

@namjaejeon
could you tell me where to report the disk size to windows client? I prefer change something here to report all directories cap disksize instead of the root dir only
this may be an workaroud for this issue

@namjaejeon
Copy link
Owner

could you tell me where to report the disk size to windows client?

ksmbd report disk size of root share to windows client.

I prefer change something here to report all directories cap disksize instead of the root dir only

Sorry, Impossible. If we have tens of thousands of directories in share, the cost of a directory lookup is too high whenever be called from statfs.

@ptpt52
Copy link
Author

ptpt52 commented May 13, 2022

@namjaejeon could we provide an fake option?
say, fake return an config size to windows, this could be setup by manual

fake disksize = 1TB

@namjaejeon
Copy link
Owner

@ptpt52 Sorry, I can't. Because this option will cause other issues.
I think that you need it for auto usb mount directory in tmpfs. right ?
You need to add new share using ksmbd.addshare whenever plugging usb storage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants