From: Christoph Hellwig <hch@lst.de>
To: Viacheslav Dubeyko <slava@dubeyko.com>
Cc: glaubitz@physik.fu-berlin.de, frank.li@vivo.com, hch@lst.de,
linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 3/6] hfsplus: take the bitmap page lock for allocate/free
Date: Fri, 24 Jul 2026 07:29:31 +0200 [thread overview]
Message-ID: <20260724052931.GD4181@lst.de> (raw)
In-Reply-To: <20260722213759.1360225-4-slava@dubeyko.com>
On Wed, Jul 22, 2026 at 02:37:55PM -0700, Viacheslav Dubeyko wrote:
> The hfsplus_block_allocate() and hfsplus_block_free() kmap
> the allocation bitmap's pages and modify their bits in place
> under sbi->alloc_mutex, but without holding the page lock.
> That leaves the read-modify-write of the bitmap bits
> unprotected against a concurrent writeback of the same page,
> which can read a partially-updated bitmap word or race with
> the dirty-bit update.
>
> This patch adds taking lock_page()/unlock_page() around each
> page's kmap/modify/kunmap section.
You are still unprotected against concurrent writeback, as writeback
drops the page lock before writing the data out.
next prev parent reply other threads:[~2026-07-24 5:29 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-22 21:37 [PATCH 0/6] hfsplus: convert regular file I/O to iomap-based operations Viacheslav Dubeyko
2026-07-22 21:37 ` [PATCH 1/6] hfs/hfsplus: exchange hardcoded number of extents on named constants Viacheslav Dubeyko
2026-07-24 5:28 ` Christoph Hellwig
2026-07-22 21:37 ` [PATCH 2/6] hfsplus: rework hfsplus_get_block() logic Viacheslav Dubeyko
2026-07-24 5:28 ` Christoph Hellwig
2026-07-22 21:37 ` [PATCH 3/6] hfsplus: take the bitmap page lock for allocate/free Viacheslav Dubeyko
2026-07-24 5:29 ` Christoph Hellwig [this message]
2026-07-22 21:37 ` [PATCH 4/6] hfsplus: add iomap operations for regular file data Viacheslav Dubeyko
2026-07-24 5:32 ` Christoph Hellwig
2026-07-22 21:37 ` [PATCH 5/6] hfsplus: add iomap-based file_operations Viacheslav Dubeyko
2026-07-24 5:33 ` Christoph Hellwig
2026-07-22 21:37 ` [PATCH 6/6] hfsplus: switch address_space_operations on iomap-based support Viacheslav Dubeyko
2026-07-24 5:37 ` Christoph Hellwig
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=20260724052931.GD4181@lst.de \
--to=hch@lst.de \
--cc=frank.li@vivo.com \
--cc=glaubitz@physik.fu-berlin.de \
--cc=linux-fsdevel@vger.kernel.org \
--cc=slava@dubeyko.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.