mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
To: Baolin Liu <liubaolin12138@163.com>
Cc: <ntfs3@lists.linux.dev>, <linux-kernel@vger.kernel.org>,
	<liubaolin12138@gmail.com>, Baolin Liu <liubaolin@kylinos.cn>
Subject: Re: [PATCH] fs/ntfs3: return -ERANGE for short xattr buffers
Date: Mon, 28 Sep 2026 19:22:49 +0200	[thread overview]
Message-ID: <830f54cf-1e10-47c5-8d7b-7076dd8ac026@paragon-software.com> (raw)
In-Reply-To: <20260709071849.2558133-1-liubaolin12138@163.com>

On 7/9/26 09:18, Baolin Liu wrote:

> From: Baolin Liu <liubaolin@kylinos.cn>
>
> ntfs3 currently returns -ENODATA when the xattr exists
> but the user buffer is too small.
> Return -ERANGE instead.
>
> Signed-off-by: Baolin Liu <liubaolin@kylinos.cn>
> ---
>   fs/ntfs3/xattr.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/fs/ntfs3/xattr.c b/fs/ntfs3/xattr.c
> index 9743a63a152e..0a19668e970d 100644
> --- a/fs/ntfs3/xattr.c
> +++ b/fs/ntfs3/xattr.c
> @@ -781,7 +781,7 @@ static int ntfs_getxattr(const struct xattr_handler *handler, struct dentry *de,
>   		if (!buffer) {
>   			err = sizeof(u8);
>   		} else if (size < sizeof(u8)) {
> -			err = -ENODATA;
> +			err = -ERANGE;
>   		} else {
>   			err = sizeof(u8);
>   			*(u8 *)buffer = le32_to_cpu(ni->std_fa);
> @@ -795,7 +795,7 @@ static int ntfs_getxattr(const struct xattr_handler *handler, struct dentry *de,
>   		if (!buffer) {
>   			err = sizeof(u32);
>   		} else if (size < sizeof(u32)) {
> -			err = -ENODATA;
> +			err = -ERANGE;
>   		} else {
>   			err = sizeof(u32);
>   			*(u32 *)buffer = le32_to_cpu(ni->std_fa);
> @@ -835,7 +835,7 @@ static int ntfs_getxattr(const struct xattr_handler *handler, struct dentry *de,
>   		if (!buffer) {
>   			err = sd_size;
>   		} else if (size < sd_size) {
> -			err = -ENODATA;
> +			err = -ERANGE;
>   		} else {
>   			err = sd_size;
>   			memcpy(buffer, sd, sd_size);

Hello,

Your patch was applied, thank you.

Regards,
Konstantin


      parent reply	other threads:[~2026-09-28 17:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-09  7:18 Baolin Liu
2026-07-09  7:27 ` liubaolin
2026-09-28 17:22 ` Konstantin Komarov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=830f54cf-1e10-47c5-8d7b-7076dd8ac026@paragon-software.com \
    --to=almaz.alexandrovich@paragon-software.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liubaolin12138@163.com \
    --cc=liubaolin12138@gmail.com \
    --cc=liubaolin@kylinos.cn \
    --cc=ntfs3@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®