[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YtoT80bDyqIVuJwT@mit.edu>
Date: Thu, 21 Jul 2022 23:05:23 -0400
From: "Theodore Ts'o" <tytso@....edu>
To: Eric Whitney <enwlinux@...il.com>
Cc: Jan Kara <jack@...e.cz>, linux-ext4@...r.kernel.org
Subject: Re: [PATCH] ext4: minor defrag code improvements
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
Powered by blists - more mailing lists