[Samba] dfree command script does not work on a btrfs subvolume with qgroups (Samba 4.13.13, Debian 11)

Kristaps Esterliņš kristaps.esterlins at gmail.com
Thu Feb 17 08:14:33 UTC 2022


Good Day!

Configuration:

Debian 11
Samba 4.13.13

I have 2 x 8 Tb HDDs with btrfs filesystem with subvolume dedicated to a
samba share and I have created a disk quota:

# btrfs qgroup show -reF /srv/samba/sales


*qgroupid         rfer         excl     max_rfer     max_excl--------
  ----         ----     --------     --------0/696       117.74GiB
 117.74GiB      1.43TiB         none*

# mount /srv/samba


*/dev/sdc1 on /srv/samba type btrfs
(rw,relatime,space_cache,subvolid=696,subvol=/samba)*

# /etc/sama/smb.conf

...

















*# Default Share - "Sales"[Sales]  path = /srv/samba/sales  read only = no
# https://wiki.samba.org/index.php/Setting_up_a_Share_Using_Windows_ACLs
<https://wiki.samba.org/index.php/Setting_up_a_Share_Using_Windows_ACLs>
acl_xattr:ignore system acls = yes  # 15.02.2022 - Log activity on the
"Sales" share
# https://wiki.samba.org/index.php/Server-Side_Copy#Btrfs_Enhanced_Server-Side_Copy_Offload
<https://wiki.samba.org/index.php/Server-Side_Copy#Btrfs_Enhanced_Server-Side_Copy_Offload>
vfs objects = full_audit btrfs  full_audit:prefix = %u|%I|%m|%S
full_audit:success = mkdirat renameat unlinkat pwrite pread
full_audit:failure = none  dfree command = /usr/local/samba/bin/dfree
dfree cache time = 0*

# /usr/local/samba/bin/dfree










*#!/bin/shCUR_PATH=/srv/samba/salesTOTAL=$((`/usr/bin/btrfs qgroup show -rF
--raw $CUR_PATH --sync | /usr/bin/tail -1 | /usr/bin/awk '{print
$(NF-0)/1024}'`)) > /dev/nullUSED=$((`/usr/bin/btrfs qgroup show -rF --raw
$CUR_PATH --sync | /usr/bin/tail -1 | /usr/bin/awk '{print
$(NF-2)/1024}'`)) > /dev/nullAVAIL=$(($TOTAL-$USED)) > /dev/nullecho $TOTAL
$AVAIL 1024*

office:/usr/local/samba/bin# ls -al
total 4
drwxrwxrwx 1 root root  10 Feb 17 09:50 .
drwxr-xr-x 1 root root  12 Feb 15 11:51 ..
-rwxrwxrwx 1 root root 371 Feb 17 09:49 dfree

office:/usr/local/samba/bin# ./dfree

*1530920960 1407461464 1024*

# journalctl
 ...

Feb 17 09:29:12 office smbd_audit[59818]: [2022/02/17 09:29:12.668171,  0]
../../source3/smbd/dfree.c:133(sys_disk_free)
Feb 17 09:29:12 office smbd_audit[59818]:   sys_disk_free:
file_lines_load() failed for command '/usr/local/samba/bin/dfree .'. Error
was : No child processes

Please see the strace file - https://pastebin.com/raw/rnDy44T6
<https://pastebin.com/raw/4kWZsnqm>

Thanks!


More information about the samba mailing list