Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

file mode not correct after setfacl #4458

Closed
zhoucheng361 opened this issue Mar 6, 2024 · 1 comment
Closed

file mode not correct after setfacl #4458

zhoucheng361 opened this issue Mar 6, 2024 · 1 comment
Assignees
Labels
kind/bug Something isn't working

Comments

@zhoucheng361
Copy link
Contributor

zhoucheng361 commented Mar 6, 2024

What happened:
How to Repoduce:

# git checkout test-acl
# python3 .github/scripts/hypo/fsrand2_test.py -k test_acl

Test Code:

    def test2(self):
        state = JuicefsMachine()
        v1 = state.init_folders()
        v3 = state.set_acl(default=True, entry=v1, group='root', group_perm=set(), logical=False, mask=set(), not_recalc_mask=False, other_perm=set(), physical=False, recalc_mask=True, recursive=True, rootdir1='/tmp/fsrand', rootdir2='/tmp/jfs/fsrand', set_mask=True, sudo_user='root', user='user1', user_perm={v1, 'r', 'w', 'x'})
        state.create_file(content=b'', file_name='afds', mode='w', parent=v1, rootdir1='/tmp/fsrand', rootdir2='/tmp/jfs/fsrand', umask=295, user='root')
        state.teardown()

Log:

root@bench-01:~/juicefs2# python3 .github/scripts/hypo/fsrand2_test.py -k test2
setup_logger ./fsrand.log
__init__
duration is 0.03030705451965332
2024-03-06 23:45:02,002 - INFO - run_cmd: sudo -u root setfacl -d -R --mask    -m u:user1:rxw,g:root:-,o::-,m::- /tmp/fsrand/
run_cmd:getfacl /tmp/fsrand/
2024-03-06 23:45:02,008 - INFO - do_set_acl /tmp/fsrand/ with u:user1:rxw,g:root:-,o::-,m::- succeed
2024-03-06 23:45:02,008 - INFO - run_cmd: sudo -u root setfacl -d -R --mask    -m u:user1:rxw,g:root:-,o::-,m::- /tmp/jfs/fsrand/
run_cmd:getfacl /tmp/jfs/fsrand/
2024-03-06 23:45:02,019 - INFO - do_set_acl /tmp/jfs/fsrand/ with u:user1:rxw,g:root:-,o::-,m::- succeed
2024-03-06 23:45:02,019 - INFO - do_create_file /tmp/fsrand/afds with mode w succeed
2024-03-06 23:45:02,026 - INFO - do_create_file /tmp/jfs/fsrand/afds with mode w succeed
F
======================================================================
FAIL: test2 (__main__.TestFsrand2)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".github/scripts/hypo/fsrand2_test.py", line 17, in test2
    state.create_file(content=b'', file_name='afds', mode='w', parent=v1, rootdir1='/tmp/fsrand', rootdir2='/tmp/jfs/fsrand', umask=295, user='root')
  File "/root/juicefs2/.github/scripts/hypo/fsrand2.py", line 178, in create_file
    parent = Folders.filter(lambda x: x != multiple()),
  File "/root/hypothesis/hypothesis-python/src/hypothesis/stateful.py", line 681, in rule_wrapper
    return f(*args, **kwargs)
  File "/root/juicefs2/.github/scripts/hypo/fsrand2.py", line 178, in create_file
    parent = Folders.filter(lambda x: x != multiple()),
  File "/root/hypothesis/hypothesis-python/src/hypothesis/stateful.py", line 802, in precondition_wrapper
    return f(*args, **kwargs)
  File "/root/juicefs2/.github/scripts/hypo/fsrand2.py", line 191, in create_file
    assert self.equal(result1, result2, rootdir1, rootdir2), f'\033[31mcreate_file:\nresult1 is {result1}\nresult2 is {result2}\033[0m'
AssertionError: create_file:
result1 is (0, 0, 3, '0o100660', 1)
result2 is (0, 0, 3, '0o100220', 1)

What you expected to happen:

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know?

Environment:

  • JuiceFS version (use juicefs --version) or Hadoop Java SDK version:
  • Cloud provider or hardware configuration running JuiceFS:
  • OS (e.g cat /etc/os-release):
  • Kernel (e.g. uname -a):
  • Object storage (cloud provider and region, or self maintained):
  • Metadata engine info (version, cloud provider managed or self maintained):
  • Network connectivity (JuiceFS to metadata engine, JuiceFS to object storage):
  • Others:
@zhoucheng361 zhoucheng361 added the kind/bug Something isn't working label Mar 6, 2024
@jiefenghuang jiefenghuang self-assigned this Mar 7, 2024
jiefenghuang added a commit to jiefenghuang/juicefs that referenced this issue Mar 8, 2024
@jiefenghuang
Copy link
Contributor

fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants