From: Matthew Wilcox <willy@infradead.org>
To: "Yuezhang.Mo@sony.com" <Yuezhang.Mo@sony.com>
Cc: "linkinjeon@kernel.org" <linkinjeon@kernel.org>,
	"sj1557.seo@samsung.com" <sj1557.seo@samsung.com>,
	"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
	"Andy.Wu@sony.com" <Andy.Wu@sony.com>,
	"Wataru.Aoyama@sony.com" <Wataru.Aoyama@sony.com>
Subject: Re: [PATCH] exfat: fix file not locking when writing zeros in exfat_file_mmap()
Date: Wed, 24 Jan 2024 05:21:29 +0000	[thread overview]
Message-ID: <ZbCeWQnoc8XooIxP@casper.infradead.org> (raw)
In-Reply-To: <PUZPR04MB63168A32AB45E8924B52CBC2817B2@PUZPR04MB6316.apcprd04.prod.outlook.com>
On Wed, Jan 24, 2024 at 05:00:37AM +0000, Yuezhang.Mo@sony.com wrote:
> inode->i_rwsem should be locked when writing file. But the lock
> is missing when writing zeros to the file in exfat_file_mmap().
This is actually very weird behaviour in exfat.  This kind of "I must
manipulate the on-disc layout" is not generally done in mmap(), it's
done in ->page_mkwrite() or even delayed until we actually do writeback.
Why does exfat do this?
next prev parent reply	other threads:[~2024-01-24  5:21 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-24  5:00 [PATCH] exfat: fix file not locking when writing zeros in exfat_file_mmap() Yuezhang.Mo
2024-01-24  5:21 ` Matthew Wilcox [this message]
2024-01-24 10:05   ` Yuezhang.Mo
2024-01-24 14:02     ` Matthew Wilcox
2024-01-26  5:43       ` Yuezhang.Mo
2024-01-24 21:35     ` Dave Chinner
2024-01-25 10:19       ` Namjae Jeon
2024-01-26  1:22         ` Dave Chinner
2024-01-26  2:54           ` Matthew Wilcox
2024-01-26 22:32             ` Dave Chinner
2024-01-26 22:41               ` Matthew Wilcox
2024-03-06 22:31                 ` Dave Chinner
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=ZbCeWQnoc8XooIxP@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=Andy.Wu@sony.com \
    --cc=Wataru.Aoyama@sony.com \
    --cc=Yuezhang.Mo@sony.com \
    --cc=linkinjeon@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=sj1557.seo@samsung.com \
    /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;
as well as URLs for NNTP newsgroup(s).