Skip to content

Commit 394440d

Browse files
jeffmahoneyjankara
authored andcommitted
reiserfs: fix handling of -EOPNOTSUPP in reiserfs_for_each_xattr
Commit 60e4cf6 (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: 60e4cf6 ("reiserfs: fix extended attributes on the root directory") CC: [email protected] # Commit 60e4cf6 was picked up by stable Link: https://lore.kernel.org/r/[email protected] Reported-by: Michael Brunnbauer <[email protected]> Signed-off-by: Jeff Mahoney <[email protected]> Signed-off-by: Jan Kara <[email protected]>
1 parent c79f46a commit 394440d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

fs/reiserfs/xattr.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,12 @@ static int reiserfs_for_each_xattr(struct inode *inode,
319319
out_dir:
320320
dput(dir);
321321
out:
322-
/* -ENODATA isn't an error */
323-
if (err == -ENODATA)
322+
/*
323+
* -ENODATA: this object doesn't have any xattrs
324+
* -EOPNOTSUPP: this file system doesn't have xattrs enabled on disk.
325+
* Neither are errors
326+
*/
327+
if (err == -ENODATA || err == -EOPNOTSUPP)
324328
err = 0;
325329
return err;
326330
}

0 commit comments

Comments
 (0)