mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Viacheslav Dubeyko <slava@dubeyko.com>
To: Hengyu Liang <hengyul@cs.unc.edu>
Cc: glaubitz@physik.fu-berlin.de, frank.li@vivo.com,
	 linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/2] hfs: fall back to buffered I/O for direct writes past phys_size
Date: Mon, 02 Nov 2026 14:24:23 -0800	[thread overview]
Message-ID: <bf9e6dd5ba33b10187d6db47b0a361e34a0d04d6.camel@dubeyko.com> (raw)
In-Reply-To: <20261030042903.4160506-1-hengyul@cs.unc.edu>

On Fri, 2026-10-30 at 00:29 -0400, Hengyu Liang wrote:
> Hi Slava,
> 
> As discussed in the setattr thread [1], a direct write that ends past
> phys_size loses data at the last close, because hfs_file_truncate()
> zeroes the file from phys_size up to i_size. Patch 1 makes such
> writes
> fall back to buffered I/O, as FAT does. Patch 2 is the
> hfs_file_truncate() cleanup you suggested.
> 
> The series applies on top of "hfs: report errors when extending files
> with setattr" v2 [2], which patch 2 needs. The HFS+ fix is sent
> separately.
> 
> Tested in KVM with KASAN, all 805 fstests on HFS with that v2
> applied:
> 26 failures without the series, 14 with patch 1 and 15 with both, no
> new failures. The extra one, generic/589, fails on and off on all
> three
> kernels with "invalid MDB drNxtCNID", the next CNID issue from the
> CNID
> thread.
> 
> [1]
> https://lore.kernel.org/linux-fsdevel/161fab786f919adb384fbf22dc19f3289bf5f24d.camel@dubeyko.com/
> [2]
> https://lore.kernel.org/linux-fsdevel/20261021145627.288953-1-hengyul@cs.unc.edu/
> 
> Hengyu Liang (2):
>   hfs: fall back to buffered I/O for direct writes past phys_size
>   hfs: remove the dead grow path from hfs_file_truncate()
> 
>  fs/hfs/extent.c | 18 ++----------------
>  fs/hfs/inode.c  | 10 ++++++++++
>  2 files changed, 12 insertions(+), 16 deletions(-)
> 
> 
> base-commit: a804c5742bff224d4cb4d25dd383554d598be32b
> prerequisite-patch-id: 737ea6125c4a7fa08a4deb38cf33d27fb791a812

The main plan is to rework as HFS+ as HFS code to remove the
hfsplus_direct_IO(), hfs_direct_IO(). I am already working in HFS+ code
[1]. If you like I can suggest to you to do the same on HFS side. But,
unfortunately, this modification will be completely wiped out in the
future. Would you like to take the task of reworking HFS code by
removing hfs_direct_IO()? You can follow by HFS+ pattern (if it works).

Thanks,
Slava.

[1]
https://lore.kernel.org/linux-fsdevel/20260914233941.2966421-1-slava@dubeyko.com/


      parent reply	other threads:[~2026-11-02 22:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-30  4:29 Hengyu Liang
2026-10-30  4:29 ` [PATCH 1/2] " Hengyu Liang
2026-10-30  4:29 ` [PATCH 2/2] hfs: remove the dead grow path from hfs_file_truncate() Hengyu Liang
2026-10-31  8:59 ` [syzbot ci] Re: hfs: fall back to buffered I/O for direct writes past phys_size syzbot ci
2026-11-02 22:24 ` Viacheslav Dubeyko [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=bf9e6dd5ba33b10187d6db47b0a361e34a0d04d6.camel@dubeyko.com \
    --to=slava@dubeyko.com \
    --cc=frank.li@vivo.com \
    --cc=glaubitz@physik.fu-berlin.de \
    --cc=hengyul@cs.unc.edu \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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®