1、open multi channel support,map samba share to y:\ 2、copy a file in samba to win10 C:\ 3、get error y: not usable. message in samba: sys_path_to_bdev() failed for path [.]! ..source3/lib/sysquotas.c:458(sys_get_quota) I have mntent in my system.
int sys_get_quota(const char *path, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *dp) { int ret = -1; int i; bool ready = False; char *mntpath = NULL; char *bdev = NULL; char *fs = NULL; if (!path||!dp) smb_panic("sys_get_quota: called with NULL pointer"); if (command_get_quota(path, qtype, id, dp)==0) { return 0; } else if (errno != ENOSYS) { return -1; } if ((ret=sys_path_to_bdev(path,&mntpath,&bdev,&fs))!=0) { DEBUG(0,("sys_path_to_bdev() failed for path [%s]!\n",path)); return ret; }
this issue also happened when I close multi channel support. So this issue is no relation to multi channel. It can copy to c:\newdir when i create a new directory on C:\.
I have the same issue since Samba 4.5.0 by just doing an "ls" in a smbclient session. It looks like the generation of the path for checking quota is wrong in the function "sys_path_to_bdev" of "sysquotas.c". For instance if I connect on a home share located in "/home/me" it'll search for a mntpath with the value "//ome/me". Obviously there is a slash badly placed. I managed to make it work with this patch, but I didn't test every input possibility : --- samba-4.5.0.ORI/source3/lib/sysquotas.c 2016-07-27 15:09:58.000000000 +0200 +++ samba-4.5.0/source3/lib/sysquotas.c 2016-09-08 15:52:45.848353018 +0200 @@ -99,8 +99,7 @@ stat_mntpath, strerror(errno)); goto out; } - if (S.st_ex_dev != devno) { - *p = '/'; + if (S.st_ex_dev == devno) { break; }
Created attachment 12552 [details] possible fix
(In reply to mamachine from comment #3) """ For instance if I connect on a home share located in "/home/me" it'll search for a mntpath with the value "//ome/me". """ Would you agree that before the fix, if the share is in /home/me, and the mount point is /home, then it'll search a mntpath with the value "//ome", not "//ome/me"? Does the attached patch fix the issue?
I agree with you, the mntpath value was "//ome", not "//ome/me" in my case. I also confirm that your patch fix the issue for me. Thanks.
The bug is a regression introduced by the improvement of avoiding stat of all mount points in the system just in order to find our mount point. This is only in the 4.5 and master branches.
Created attachment 12554 [details] git-am fix for 4.5.next
Re-assigning to Karolin for inclusion in 4.5.next.
(In reply to Jeremy Allison from comment #10) Pushed to autobuild-v4-5-test.
(In reply to Karolin Seeger from comment #11) Pushed to v4-5-test. Closing out bug report. Thanks!