All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] reiserfs: fix handling of -EOPNOTSUPP in reiserfs_for_each_xattr
@ 2020-01-15 18:00 jeffm
  2020-01-16 15:53 ` Jan Kara
  0 siblings, 1 reply; 2+ messages in thread
From: jeffm @ 2020-01-15 18:00 UTC (permalink / raw)
  To: reiserfs-devel, jack; +Cc: brunni, Jeff Mahoney

From: Jeff Mahoney <jeffm@suse.com>

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: 60e4cf67a58 (reiserfs: fix extended attributes on the root directory)
Reported-by: Michael Brunnbauer <brunni@netestate.de>
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
---
 fs/reiserfs/xattr.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/fs/reiserfs/xattr.c b/fs/reiserfs/xattr.c
index 06497965f0a0..d843c4789ced 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;
 }
-- 
2.16.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] reiserfs: fix handling of -EOPNOTSUPP in reiserfs_for_each_xattr
  2020-01-15 18:00 [PATCH] reiserfs: fix handling of -EOPNOTSUPP in reiserfs_for_each_xattr jeffm
@ 2020-01-16 15:53 ` Jan Kara
  0 siblings, 0 replies; 2+ messages in thread
From: Jan Kara @ 2020-01-16 15:53 UTC (permalink / raw)
  To: jeffm; +Cc: reiserfs-devel, jack, brunni

On Wed 15-01-20 13:00:59, jeffm@suse.com wrote:
> From: Jeff Mahoney <jeffm@suse.com>
> 
> 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: 60e4cf67a58 (reiserfs: fix extended attributes on the root directory)
> Reported-by: Michael Brunnbauer <brunni@netestate.de>
> Signed-off-by: Jeff Mahoney <jeffm@suse.com>

Thanks Jeff! I've queued the patch to my tree and will push it to Linus
next week.

								Honza

> ---
>  fs/reiserfs/xattr.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/reiserfs/xattr.c b/fs/reiserfs/xattr.c
> index 06497965f0a0..d843c4789ced 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;
>  }
> -- 
> 2.16.4
> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-01-16 15:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-15 18:00 [PATCH] reiserfs: fix handling of -EOPNOTSUPP in reiserfs_for_each_xattr jeffm
2020-01-16 15:53 ` Jan Kara

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.