[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <9817dbc0-0bb6-4e31-8413-c54b12ce952b@kernel.org>
Date: Sun, 21 Dec 2025 11:00:00 +0100
From: Daniel Gomez <da.gomez@...nel.org>
To: James Bottomley <James.Bottomley@...senPartnership.com>,
"Martin K. Petersen" <martin.petersen@...cle.com>,
Hannes Reinecke <hare@...e.de>
Cc: Luis Chamberlain <mcgrof@...nel.org>, Petr Pavlu <petr.pavlu@...e.com>,
Sami Tolvanen <samitolvanen@...gle.com>, Aaron Tomlin <atomlin@...mlin.com>,
Lucas De Marchi <demarchi@...nel.org>, linux-scsi@...r.kernel.org,
target-devel@...r.kernel.org, linux-modules@...r.kernel.org,
linux-kernel@...r.kernel.org, Daniel Gomez <da.gomez@...sung.com>
Subject: Re: [PATCH 0/2] scsi: target+fcoe: replace -EEXIST with -EBUSY in
module_init() paths
On 21/12/2025 05.02, James Bottomley wrote:
> On Sun, 2025-12-21 at 04:30 +0100, Daniel Gomez wrote:
>> On 20/12/2025 05.27, James Bottomley wrote:
>>> On Sat, 2025-12-20 at 04:37 +0100, Daniel Gomez wrote:
> None of that answers the why question: Given that EEXIST is used all
> over the kernel, for what appear to be fairly legitimate cases, why
> would we suddenly want it to become only for modules? I get that we
> can, as you propose patches above, but why should we bother? It seems
> to be a useful error code outside the module use case, so why the need
> to restrict it to being only for modules?
Because both the module loader and module_init() return through the same
(f)init_module() syscall path, we need to ensure consistency in what we report
back to userspace. The init_module(2) man page documents EEXIST as "a module
with this name is already loaded." When module_init() returns EEXIST for
a different reason, userspace tools following the documented behavior will
misinterpret it. We can't use the same error code for different meanings and
expect the caller to differentiate.
Powered by blists - more mailing lists