diff options
author | Jeff Mahoney <jeffm@suse.com> | 2020-01-15 13:00:59 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-01-23 08:21:38 +0100 |
commit | d28d607908c7a7ab428872fa50871b9bb5bd3450 (patch) | |
tree | 6b706c1e6858c7bec34cb9e7078f9f1af6ca0f96 /fs | |
parent | 7b88ac504746972c6a0ad99d017311f4a4251ab0 (diff) | |
download | linux-stable-d28d607908c7a7ab428872fa50871b9bb5bd3450.tar.gz linux-stable-d28d607908c7a7ab428872fa50871b9bb5bd3450.tar.bz2 linux-stable-d28d607908c7a7ab428872fa50871b9bb5bd3450.zip |
reiserfs: fix handling of -EOPNOTSUPP in reiserfs_for_each_xattr
commit 394440d469413fa9b74f88a11f144d76017221f2 upstream.
Commit 60e4cf67a58 (reiserfs: fix extended attributes on the root
directory) introduced a regression open_xa_root started returning
-EOPNOTSUPP but it was not handled properly in reiserfs_for_each_xattr.
When the reiserfs module is built without CONFIG_REISERFS_FS_XATTR,
deleting an inode would result in a warning and chowning an inode
would also result in a warning and then fail to complete.
With CONFIG_REISERFS_FS_XATTR enabled, the xattr root would always be
present for read-write operations.
This commit handles -EOPNOSUPP in the same way -ENODATA is handled.
Fixes: 60e4cf67a582 ("reiserfs: fix extended attributes on the root directory")
CC: stable@vger.kernel.org # Commit 60e4cf67a58 was picked up by stable
Link: https://lore.kernel.org/r/20200115180059.6935-1-jeffm@suse.com
Reported-by: Michael Brunnbauer <brunni@netestate.de>
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/reiserfs/xattr.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/reiserfs/xattr.c b/fs/reiserfs/xattr.c index 2c5c45927b2f..ee216925a709 100644 --- a/fs/reiserfs/xattr.c +++ b/fs/reiserfs/xattr.c @@ -319,8 +319,12 @@ static int reiserfs_for_each_xattr(struct inode *inode, out_dir: dput(dir); out: - /* -ENODATA isn't an error */ - if (err == -ENODATA) + /* + * -ENODATA: this object doesn't have any xattrs + * -EOPNOTSUPP: this file system doesn't have xattrs enabled on disk. + * Neither are errors + */ + if (err == -ENODATA || err == -EOPNOTSUPP) err = 0; return err; } |