LU-12275 sec: verify dir is empty when setting enc policy
When setting an encryption policy on a directory that we want to
be encrypted, make sure it is empty.
Otherwise return -ENOTEMPTY from server to client doing the ioctl.
Also add test to exercise the ioctl interface to get/set encryption
policies on directories, thanks to the fscrypt userspace tool.
And test the ability to lock an encrypted directory.
Fixes:
40d91eafe257 ("LU-12275 sec: atomicity of encryption context getting/setting")
Test-Parameters: testlist=sanity-sec envdefinitions=ONLY="36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 52 53 54" clientdistro=el8.1 fstype=ldiskfs mdscount=2 mdtcount=4
Test-Parameters: testlist=sanity-sec envdefinitions=ONLY="36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 52 53 54" clientdistro=el8.1 fstype=zfs mdscount=2 mdtcount=4
Signed-off-by: Sebastien Buisson <sbuisson@ddn.com>
Change-Id: Iabffd24800314b12908f505d7e66492be7292a16
Reviewed-on: https://review.whamcloud.com/39617
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Lai Siyao <lai.siyao@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>