Whamcloud - gitweb
LU-12275 sec: verify dir is empty when setting enc policy 17/39617/10
authorSebastien Buisson <sbuisson@ddn.com>
Tue, 11 Aug 2020 13:36:41 +0000 (22:36 +0900)
committerOleg Drokin <green@whamcloud.com>
Sat, 19 Sep 2020 14:11:55 +0000 (14:11 +0000)
commite8f74fb0f5c9306ee5a099133799e03e09ca8e47
tree95cedc6844234eb4c5dfa7bc2a7fd41425002763
parenta6798c5806088dc1892dd752012a54f0ec8f1798
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>
lustre/mdd/mdd_internal.h
lustre/tests/sanity-sec.sh