All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paulo Alcantara <pc@manguebit.org>
To: Namjae Jeon <linkinjeon@kernel.org>
Cc: linux-cifs@vger.kernel.org,
	Ronnie Sahlberg <ronniesahlberg@gmail.com>,
	Shyam Prasad N <sprasad@microsoft.com>,
	Tom Talpey <tom@talpey.com>, Bharath SM <bharathsm@microsoft.com>,
	stable@vger.kernel.org
Subject: Re: [PATCH] smb: client: fix data corruption with concurrent writes and O_TRUNC
Date: Sun, 30 Aug 2026 13:43:22 -0300	[thread overview]
Message-ID: <ff527b2379048e28e0b2e66abdeb1aba@manguebit.org> (raw)
In-Reply-To: <CAKYAXd_cR_WAd-3iRW_KJRmSBKxNiSuGvjNXXk33pG3Z_2dBvA@mail.gmail.com>

Namjae Jeon <linkinjeon@kernel.org> writes:

> Should we also take filemap_invalidate_lock_shared() in the
> page_mkwrite path to serialize mmap writes with this truncate path?

I don't think so.  It's serialised by the folio lock that
netfs_page_mkwrite() and truncate_inode_pages() take.  Also, if a new
writable page was added between the first unmap and
truncate_inode_pages(), or if a new page is about to be become writable,
both paths should go through filemap_fault(), which takes
invalidate_lock shared, so they will both serialise with invalidate_lock
exclusive in cifs_do_truncate().

  reply	other threads:[~2026-08-30 16:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-28 23:12 [PATCH] smb: client: fix data corruption with concurrent writes and O_TRUNC Paulo Alcantara
2026-08-29  2:01 ` Namjae Jeon
2026-08-30 16:43   ` Paulo Alcantara [this message]
2026-08-31  0:42     ` Namjae Jeon

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=ff527b2379048e28e0b2e66abdeb1aba@manguebit.org \
    --to=pc@manguebit.org \
    --cc=bharathsm@microsoft.com \
    --cc=linkinjeon@kernel.org \
    --cc=linux-cifs@vger.kernel.org \
    --cc=ronniesahlberg@gmail.com \
    --cc=sprasad@microsoft.com \
    --cc=stable@vger.kernel.org \
    --cc=tom@talpey.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 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.