The branch, master has been updated via 526a387 selftest: un-flap samba3.blackbox.dfree_quota via e7a8ef4 selftest: fix test_dfree_quota.sh via 05a1ba8 selftest: add test case for different quote/dfree block size via 67c8971 smbd: show correct disk size for different quota and dfree block sizes from 6bbf7d8 ctdb: NAT gateway capability and control to set it are obsolete
https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit 526a3878382582d2f83aee900d9afeadfc53462a Author: Uri Simchoni <u...@samba.org> Date: Wed Jan 27 22:09:51 2016 +0200 selftest: un-flap samba3.blackbox.dfree_quota Remove test from flapping list after fix. Signed-off-by: Uri Simchoni <u...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> Autobuild-User(master): Jeremy Allison <j...@samba.org> Autobuild-Date(master): Thu Jan 28 01:10:54 CET 2016 on sn-devel-144 commit e7a8ef4f260cc3d07654664c9e547263a2bc8ee6 Author: Uri Simchoni <u...@samba.org> Date: Wed Jan 27 21:47:30 2016 +0200 selftest: fix test_dfree_quota.sh Eliminate backslashes from smbcquotas output so that we don't have to deal with them correctly when parsing the output. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11697 Signed-off-by: Uri Simchoni <u...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> commit 05a1ba899583d38a85f460990e946fa2fde30cd1 Author: Uri Simchoni <u...@samba.org> Date: Tue Jan 19 14:38:03 2016 +0200 selftest: add test case for different quote/dfree block size BUG: https://bugzilla.samba.org/show_bug.cgi?id=11681 Signed-off-by: Uri Simchoni <u...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> commit 67c89715d00abc588239d8220f09cf51a58db05a Author: Uri Simchoni <u...@samba.org> Date: Tue Jan 19 14:57:16 2016 +0200 smbd: show correct disk size for different quota and dfree block sizes When file system stats (VFS disk_free_fn) and quota (VFS get_quota_fn) return different block sizes, normalize values before comparing. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11681 Signed-off-by: Uri Simchoni <u...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> ----------------------------------------------------------------------- Summary of changes: selftest/flapping | 1 - source3/script/tests/test_dfree_quota.sh | 9 +++++++-- source3/smbd/dfree.c | 9 ++++++++- 3 files changed, 15 insertions(+), 4 deletions(-) Changeset truncated at 500 lines: diff --git a/selftest/flapping b/selftest/flapping index 8b05593..1928180 100644 --- a/selftest/flapping +++ b/selftest/flapping @@ -30,4 +30,3 @@ ^samba4.blackbox.samba_tool_demote # flakey on sn-devel ^samba4.blackbox.dbcheck # flakey on sn-devel ^samba4.smb2.create.mkdir-dup\(ad_dc_ntvfs\) # This test (for bug 11486) involves a race, not always protected against in the NTVFS file server -^samba3.blackbox.dfree_quota #flakey on sn-devel diff --git a/source3/script/tests/test_dfree_quota.sh b/source3/script/tests/test_dfree_quota.sh index c693b7b..6240b56 100755 --- a/source3/script/tests/test_dfree_quota.sh +++ b/source3/script/tests/test_dfree_quota.sh @@ -64,6 +64,8 @@ trygrp1:g$gid:block size = 4096:hard limit = 60:soft limit = 60:cur blocks = 55 trygrp2:df:block size = 4096:disk free = 10:disk size = 80 trygrp2:u$uid:block size = 4096:hard limit = 0:soft limit = 0:cur blocks = 41 trygrp2:g$gid:block size = 4096:hard limit = 60:soft limit = 60:cur blocks = 56 +blksize:df:block size = 512:disk free = 614400:disk size = 614400 +blksize:u$uid:block size = 1024:hard limit = 512000:soft limit = 0:cur blocks = 0 ABC } @@ -128,10 +130,10 @@ test_smbcquotas() { shift subunit_start_test "$name" setup_conf "$conf" "." - output=$($VALGRIND $smbcquotas //$SERVER/dfq $@ 2>/dev/null) + output=$($VALGRIND $smbcquotas //$SERVER/dfq $@ 2>/dev/null | tr '\\' '/') status=$? if [ "$status" = "0" ]; then - received=$(echo "$output" | awk "/$SERVER\\\\$user/ {printf \"%s%s%s\", \$3, \$4, \$5}") + received=$(echo "$output" | awk "/$SERVER\\/$user/ {printf \"%s%s%s\", \$3, \$4, \$5}") if [ "$expected" = "$received" ]; then subunit_pass_test "$name" else @@ -170,5 +172,8 @@ test_smbclient_dfree "Test quota->dfree inode hard limit" "subdir1" "ihlimit sub test_smbclient_dfree "Test quota->dfree err try group" "subdir1" "trygrp1 subdir1" "240 1024. 20" -U$USERNAME%$PASSWORD --option=clientmaxprotocol=SMB3 || failed=`expr $failed + 1` test_smbclient_dfree "Test quota->dfree no-quota try group" "subdir1" "trygrp2 subdir1" "240 1024. 16" -U$USERNAME%$PASSWORD --option=clientmaxprotocol=SMB3 || failed=`expr $failed + 1` +#block size different in quota and df systems +test_smbclient_dfree "Test quota->dfree different block size" "subdir1" "blksize subdir1" "307200 1024. 307200" -U$USERNAME%$PASSWORD --option=clientmaxprotocol=SMB3 || failed=`expr $failed + 1` + setup_conf exit $failed diff --git a/source3/smbd/dfree.c b/source3/smbd/dfree.c index 62d2ea4..765fbe6 100644 --- a/source3/smbd/dfree.c +++ b/source3/smbd/dfree.c @@ -124,7 +124,14 @@ uint64_t sys_disk_free(connection_struct *conn, const char *path, } if (disk_quotas(conn, path, &bsize_q, &dfree_q, &dsize_q)) { - (*bsize) = bsize_q; + uint64_t min_bsize = MIN(*bsize, bsize_q); + + (*dfree) = (*dfree) * (*bsize) / min_bsize; + (*dsize) = (*dsize) * (*bsize) / min_bsize; + dfree_q = dfree_q * bsize_q / min_bsize; + dsize_q = dsize_q * bsize_q / min_bsize; + + (*bsize) = min_bsize; (*dfree) = MIN(*dfree,dfree_q); (*dsize) = MIN(*dsize,dsize_q); } -- Samba Shared Repository