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

Problems switching between xattr=dir and xattr=sa #727

Closed
chrisrd opened this issue May 8, 2012 · 0 comments
Closed

Problems switching between xattr=dir and xattr=sa #727

chrisrd opened this issue May 8, 2012 · 0 comments
Milestone

Comments

@chrisrd
Copy link
Contributor

chrisrd commented May 8, 2012

Switching between xattr=dir and xattr=sa then updating/removing xattrs been previously set with the other xattr=[dir|sa] style causes problems.

E.g.:

#
# Start with xattr=dir
#
zfs create -o xattr=dir pool/test
touch /pool/test/foo
setfattr -n user.foo -v one /pool/test/foo
getfattr -n user.foo /pool/test/foo
getfattr: Removing leading '/' from absolute path names
# file: pool/test/foo
user.foo="one"

#
# Switch to xattr=sa
#
zfs set xattr=sa pool/test

#
# previous xattr is still readable
#
getfattr -n user.foo /pool/test/foo
getfattr: Removing leading '/' from absolute path names
# file: pool/test/foo
user.foo="one"

#
# Setting a different value on the old xattr is ok
#
setfattr -n user.foo -v two /pool/test/foo
getfattr -n user.foo /pool/test/foo
getfattr: Removing leading '/' from absolute path names
# file: pool/test/foo
user.foo="two"

#
# Deleting the old xattr doesn't work
# (Note: normal getfattr output would be "No such attribute")
#
setfattr -x user.foo /pool/test/foo
getfattr -n user.foo /pool/test/foo
/pool/test/foo: user.foo: Invalid argument

#
# Trying to set it again also fails
#
setfattr -n user.foo -v three /pool/test/foo
setfattr: /pool/test/foo: Invalid argument

#
# Go back to xattr=dir
#
zfs set xattr=dir pool/test

#
# Reading the xattr fails
#
getfattr -n user.foo /pool/test/foo
/pool/test/foo: user.foo: Invalid argument

#
# Trying to set it again fails
#
setfattr -n user.foo -v four /pool/test/foo
setfattr: /pool/test/foo: Invalid argument

#
# Trying to delete it fails
#
# setfattr -x user.foo /pool/test/foo
setfattr: /pool/test/foo: Invalid argument

And in the other direction, i.e. xattr=sa to xattr=dir

#
# Start with xattr=sa
#
zfs create -o xattr=sa pool/test
touch /pool/test/foo
setfattr -n user.foo -v one /pool/test/foo
getfattr -n user.foo /pool/test/foo
getfattr: Removing leading '/' from absolute path names
# file: pool/test/foo
user.foo="one"

#
# Switch to xattr=dir
#
zfs set xattr=dir pool/test

#
# previous xattr is still readable
#
getfattr -n user.foo /pool/test/foo
getfattr: Removing leading '/' from absolute path names
# file: pool/test/foo
user.foo="one"

#
# Setting a different value on the old xattr doesn't
# complain, but also doesn't work
#
setfattr -n user.foo -v two /pool/test/foo
getfattr -n user.foo /pool/test/foo
getfattr: Removing leading '/' from absolute path names
# file: pool/test/foo
user.foo="one"

#
# And in fact we now have two copies of the old xattr??
#
getfattr -d /pool/test/foo
getfattr: Removing leading '/' from absolute path names
# file: pool/test/foo
user.foo="one"
user.foo="one"

#
# Deleting the xattr leaves one copy
#
setfattr -x user.foo /pool/test/foo
getfattr -d /pool/test/foo
getfattr: Removing leading '/' from absolute path names
# file: pool/test/foo
user.foo="one"

#
# Deleting the 2nd copy of the xattr doesn't work
#
setfattr -x user.foo /pool/test/foo
getfattr -d /pool/test/foo
getfattr: Removing leading '/' from absolute path names
# file: pool/test/foo
user.foo="one"
behlendorf added a commit to behlendorf/zfs that referenced this issue Aug 25, 2012
This reverts commit ec2626a which
caused consistency problems between the shared and private handles.
Reverting this change should resolve issues openzfs#709 and openzfs#727.  It
will also reintroduce an arc_anon memory leak which is addressed
by the next commit.

Signed-off-by: Brian Behlendorf <[email protected]>
Issue openzfs#709
Issue openzfs#727
pcd1193182 pushed a commit to pcd1193182/zfs that referenced this issue Sep 26, 2023
…zfs#727)

Bumps [tokio-stream](https://github.com/tokio-rs/tokio) from 0.1.9 to 0.1.12.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](tokio-rs/tokio@tokio-stream-0.1.9...tokio-stream-0.1.12)

---
updated-dependencies:
- dependency-name: tokio-stream
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
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

2 participants