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

chattr immutable broken on zfs (master) #5469

Closed
edillmann opened this issue Dec 11, 2016 · 3 comments
Closed

chattr immutable broken on zfs (master) #5469

edillmann opened this issue Dec 11, 2016 · 3 comments

Comments

@edillmann
Copy link
Contributor

System information

Type Version/Name
Distribution Name ubuntu
Distribution Version 16.04
Linux Kernel 4.4.0-51-lowlatency
Architecture x86_64
ZFS Version 0.7.0-rc2
SPL Version 0.7.0-rc2

Describe the problem you're observing

chattr is not working properly on zfs

Simple reproducer

touch testfile
chattr -i testfile
touch testfile
touch: cannot touch 'testfile': Permission denied

lsattr testfile
---------------- testfile
@loli10K
Copy link
Contributor

loli10K commented Dec 11, 2016

Probably introduced in 64c688d (Refactor updating of immutable/appendonly flags), i can't reproduce with its parent commit.

Fortunately this doesn't seem to persist on disk, a possible workaround is to remount the filesystem.

dweeezil added a commit to dweeezil/zfs that referenced this issue Dec 12, 2016
The refactoring from 64c688d introduced new code which didn't handle
the clearing of the S_IMMUTABLE and S_APPEND flags correctly.

Fixes: openzfs#5469
@dweeezil
Copy link
Contributor

See #5470 for a fix.

@edillmann
Copy link
Contributor Author

That was a quick fix, it work's for me, thanks

behlendorf added a commit that referenced this issue Dec 19, 2016
This branch contains the following fixes/improvements.

* Fix setting i_flags
* Fix wrong operator in xvattr.h
* Fix fchange macro in zpl_ioctl_setflags()
* Added configure check to use inode_set_flags()
* Added a test case for chattr for better test coverage

Reviewed-by: Tim Chase <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Chunwei Chen <[email protected]>
Closes #5486 
Closes #5470 
Closes #5469
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants