From: "Theodore Ts'o" <tytso@mit.edu>
To: Eric Whitney <enwlinux@gmail.com>
Cc: Jan Kara <jack@suse.cz>, linux-ext4@vger.kernel.org
Subject: Re: [PATCH] ext4: minor defrag code improvements
Date: Thu, 21 Jul 2022 23:05:23 -0400 [thread overview]
Message-ID: <YtoT80bDyqIVuJwT@mit.edu> (raw)
In-Reply-To: <YtgbKhYxbX4NPJts@debian-BULLSEYE-live-builder-AMD64>
On Wed, Jul 20, 2022 at 11:11:38AM -0400, Eric Whitney wrote:
> > Is ETXTBUSY still reported by the kernel? I couldn't find it in a search after
> > reading this: lwn.net/Articles/866493/
> > I didn't consider that because an executable wasn't involved - interesting that
> > it was used for some operations applied to swap files.
The LWN article is specifically about whether it's worth it to block
writes to executable files.
However, if you look at some places where ETXTBSY is returned, such as
in fs/open.c and fs/read_write.c, it's being returned when there is
attempt to operate on a swap file using fallocate(2), write(2) or
copy_file(2). So I agree with Jan that it's better for the defrag
code to be consistent those uses of ETXTBSY.
I'll also add that, "busy" does make some sense as a concept, since if
you run "swapoff", you can now defrag the file, since it's no longer
being used as a swap file --- hence, it's no longer busy. So I don't
have as visceral reaction to using EBUSY, but given the other ways
defrag might return EBUSY where it *would* make sense to retry the
defrag, I agree that changing the error return in the case of an
attempted defrag of a swap file to ETXTBSY makes sense.
- Ted
next prev parent reply other threads:[~2022-07-22 3:05 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-21 14:33 [PATCH] ext4: minor defrag code improvements Eric Whitney
2022-07-14 11:53 ` Jan Kara
2022-07-19 21:35 ` Eric Whitney
2022-07-20 15:11 ` Eric Whitney
2022-07-22 3:05 ` Theodore Ts'o [this message]
2022-07-22 14:46 ` Eric Whitney
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=YtoT80bDyqIVuJwT@mit.edu \
--to=tytso@mit.edu \
--cc=enwlinux@gmail.com \
--cc=jack@suse.cz \
--cc=linux-ext4@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 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.