Linux-EROFS Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Gao Xiang <xiang@kernel.org>
To: sadmanf@meta.com
Cc: linux-erofs@lists.ozlabs.org, Gao Xiang <xiang@kernel.org>,
	Chao Yu <chao@kernel.org>
Subject: Re: [PATCH RESEND 2/2] erofs-utils: lib: close source fd on early errors in erofs_mkfs_begin_nondirectory()
Date: Tue, 6 Oct 2026 22:57:56 +0200	[thread overview]
Message-ID: <asVg1MqkA3I7Gd7a@MacBookPro> (raw)
In-Reply-To: <20261006-round1-v1-2-f46b13e11de5@meta.com>

On Tue, Oct 06, 2026 at 02:04:48PM -0400, Sadman Fahmid via B4 Relay wrote:
> From: Sadman Fahmid <sadmanf@meta.com>
> 
> If erofs_set_inode_fingerprint() or erofs_prepare_compressed_file()
> fails, the source file descriptor opened just above is never closed
> since the job carrying it is never queued.  Close it on those paths.
> 
> The diskbuf descriptor is left alone as it is owned by the diskbuf.
> 
> Signed-off-by: Sadman Fahmid <sadmanf@meta.com>
> 
> ---
> The erofs_begin_compressed_file() failure path is left as is: with
> multi-threaded compression, z_erofs_mt_compress() may fail after some
> segments have already been queued to workers that read from the fd,
> so closing it there would be unsafe.


I applied this.  Although yeah, the failure path needs to be revisited
later.

Thanks,
Gao Xiang


  reply	other threads:[~2026-10-06 20:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-06 18:04 [PATCH RESEND 0/2] erofs-utils: lib: fix a short-read hang and an fd leak Sadman Fahmid via B4 Relay
2026-10-06 18:04 ` [PATCH RESEND 1/2] erofs-utils: lib: fail instead of hanging on short reads in erofs_io_xcopy() Sadman Fahmid via B4 Relay
2026-10-06 20:51   ` [PATCH RESEND 1/2] erofs-utils: lib: fail instead of hanging on short reads in erofs_io_xcopy()y Gao Xiang
2026-10-06 18:04 ` [PATCH RESEND 2/2] erofs-utils: lib: close source fd on early errors in erofs_mkfs_begin_nondirectory() Sadman Fahmid via B4 Relay
2026-10-06 20:57   ` Gao Xiang [this message]
2026-10-07 19:15 ` [PATCH v2] erofs-utils: lib: fail instead of hanging on short reads in erofs_io_xcopy() Sadman Fahmid via B4 Relay
2026-10-07 20:15   ` Gao Xiang

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=asVg1MqkA3I7Gd7a@MacBookPro \
    --to=xiang@kernel.org \
    --cc=chao@kernel.org \
    --cc=linux-erofs@lists.ozlabs.org \
    --cc=sadmanf@meta.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