diff --git a/src/middlewared/middlewared/plugins/pool_/dataset.py b/src/middlewared/middlewared/plugins/pool_/dataset.py index 0ce5120c103fd..2d2b67bc95e59 100644 --- a/src/middlewared/middlewared/plugins/pool_/dataset.py +++ b/src/middlewared/middlewared/plugins/pool_/dataset.py @@ -591,10 +591,6 @@ async def do_create(self, app, data): parent_st['acltype'] = await self.middleware.call('filesystem.path_get_acltype', parent_mp) mountpoint = os.path.join('/mnt', data['name']) - if data['type'] == 'FILESYSTEM' and data.get('acltype', 'INHERIT') == 'INHERIT' and len( - data['name'].split('/') - ) == 2: - data['acltype'] = 'POSIX' try: await self.middleware.call('filesystem.stat', mountpoint) diff --git a/tests/api2/test_nfsv4_top_level_dataset.py b/tests/api2/test_nfsv4_top_level_dataset.py new file mode 100644 index 0000000000000..5bc500872ed53 --- /dev/null +++ b/tests/api2/test_nfsv4_top_level_dataset.py @@ -0,0 +1,22 @@ +import pytest + +from middlewared.test.integration.assets.pool import dataset +from middlewared.test.integration.utils import call, pool + + +@pytest.fixture(scope='module') +def set_nfsv4_top_level(): + call('pool.dataset.update', pool, {'acltype': 'NFSV4', 'aclmode': 'PASSTHROUGH'}) + + try: + yield + finally: + call('pool.dataset.update', pool, {'acltype': 'POSIX', 'aclmode': 'DISCARD'}) + + +def test__acltype_inherit(set_nfsv4_top_level): + with dataset('v4inherit') as ds: + entry = call('pool.dataset.query', [['name', '=', ds]], {'get': True}) + + assert entry['acltype']['value'] == 'NFSV4' + assert entry['aclmode']['value'] == 'PASSTHROUGH'