mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
To: Zhenyan Wang <maximwang110@gmail.com>
Cc: Christian Brauner <brauner@kernel.org>, <ntfs3@lists.linux.dev>,
	<linux-fsdevel@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/2] fs/ntfs3: clear FILE_ATTRIBUTE_READONLY bit when argument 'mode' contains write permission
Date: Wed, 2 Dec 2026 11:41:54 +0100	[thread overview]
Message-ID: <38da7288-3d98-4457-a3ef-ddf62f76d187@paragon-software.com> (raw)
In-Reply-To: <20260927180359.3867508-2-maximwang110@gmail.com>

On 9/27/26 20:03, Zhenyan Wang wrote:

> When creating a subdirectory, ntfs3 inherits the parent's
> FILE_ATTRIBUTE_READONLY bit unconditionally, which means if the parent
> is readonly, the child is readonly by default.
>
> When argument 'mode' does not contain write permission, ntfs3 sets this
> bit to 1. However, when mode contains write permission, it does not clear
> this bit.
>
> Fix this by clearing FILE_ATTRIBUTE_READONLY when mode contains write
> permission.
>
> Signed-off-by: Zhenyan Wang <maximwang110@gmail.com>
> ---
>   fs/ntfs3/inode.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/fs/ntfs3/inode.c b/fs/ntfs3/inode.c
> index 0c9bd66..6717563 100644
> --- a/fs/ntfs3/inode.c
> +++ b/fs/ntfs3/inode.c
> @@ -1273,6 +1273,8 @@ int ntfs_create_inode(struct mnt_idmap *idmap, struct inode *dir,
>
>          if (!(mode & 0222))
>                  fa |= FILE_ATTRIBUTE_READONLY;
> +       else
> +               fa &= ~FILE_ATTRIBUTE_READONLY;
>
>          new_de = kzalloc(PATH_MAX, GFP_KERNEL);
>          if (!new_de) {
> --
> 2.53.0

Hello,

Your patch was applied, thanks.

Regards,
Konstantin


  reply	other threads:[~2026-12-02 10:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-27 18:03 [PATCH 0/2] fs/ntfs3: fixes for directory permission and symlink consistency Zhenyan Wang
2026-09-27 18:03 ` [PATCH 1/2] fs/ntfs3: clear FILE_ATTRIBUTE_READONLY bit when argument 'mode' contains write permission Zhenyan Wang
2026-12-02 10:41   ` Konstantin Komarov [this message]
2026-09-27 18:03 ` [PATCH 2/2] fs/ntfs3: keep PrintName not changed when creating symlink Zhenyan Wang
2026-09-28  7:28   ` Zhan Xusheng
2026-09-28  8:03     ` Zhenyan Wang
2026-09-27 20:30 ` [PATCH 0/2] fs/ntfs3: fixes for directory permission and symlink consistency Zhenyan Wang

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=38da7288-3d98-4457-a3ef-ddf62f76d187@paragon-software.com \
    --to=almaz.alexandrovich@paragon-software.com \
    --cc=brauner@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maximwang110@gmail.com \
    --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®