root@ami:~# btrfs sub del /test
root@ami:~# echo $?
1
root@ami:~# ls -al /test
total 0
drwx------. 1 root root 0 Aug 24 22:31 .
drwxr-xr-x. 1 root root 262 Aug 24 22:31 ..
The above is an example of it failing due to SE Linux denying read access to
the directory. While the recent SE Linux policy will allow that for all
reasonable labels error conditions should still be flagged to the operator.
Here is strace output:
openat(AT_FDCWD, "/test", O_RDONLY) = -1 EACCES (Permission denied)
close(3) = 0
exit_group(1) = ?
+++ exited with 1 +++
What I expect to see is a printf with a brief explanation of the issue so the
sysadmin doesn't need to run strace to find out what is going on and so that
if a cron job fails there will be email sent.
Also if openat() succeeds but ioctl fails later in the operation it is another
situation of a quiet exit(1) with no explanation.