Re: [PATCH 5/8] loop: merge the cryptoloop module into the main loop module

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2021/08/27 15:45, Christoph Hellwig wrote:
> On Thu, Aug 26, 2021 at 06:44:32PM +0200, Milan Broz wrote:
>> Yes, I know that removal is far disturbing thing here, if it
>> can be planned for removal later, I think it is the best thing to do...
>>
>> And I would like to know actually if there are existing users
>> (and how and why they are using this interface - it cannot be configured
>> through losetup for years IIRC).
> 
> We could just try to drop it entirely and see if anyone screams.  You
> are probably right that no one will.
> 

I recommend that we only add a patch to deprecate cryptoloop module with
a printk() when people actually try to use cryptoloop module, and then
eventually remove cryptoloop module. But that is absolutely after my patches.

You are repeatedly failing to fix this problem because you are trying to fix
a different extra thing simply because you don't like the nasty locking interactions.

I posted "[PATCH v5] block: genhd: don't call probe function with major_names_lock held"
( https://lkml.kernel.org/r/b2af8a5b-3c1b-204e-7f56-bea0b15848d6@xxxxxxxxxxxxxxxxxxx ) for v5.14 (and also stable),
and "[PATCH] loop: replace loop_ctl_mutex with loop_idr_spinlock"
( https://lkml.kernel.org/r/2642808b-a7d0-28ff-f288-0f4eabc562f7@xxxxxxxxxxxxxxxxxxx ) for v5.15 (but not stable).

Any of your further series that claims to fix this problem is invalid
until you review and fully understand my patches. You are still missing what
the loop_ctl_mutex is serializing. The loop_ctl_mutex is used for serializing
"idr_alloc() + add_disk()" sequence versus "del_gendisk() + idr_remove()"
sequence.

Your assumption in PATCH 7/8 is broken because idr_alloc() will succeed and
add_disk() will be called as soon as idr_remove() is called, and you wrongly
assumes that the Lo_deleting state can prevent further lookups. No, idr_remove()
cannot prevent further "idr_alloc() + add_disk()". In other words, idr_remove()
must not be called before del_gendisk() completes. That serialization is currently
handled by the loop_ctl_mutex, and my latter patch safely removes the loop_ctl_mutex
(at the risk of possibly changing the userspace's behavior; that's why my latter
patch is not for v5.14 but for v5.15. My former patch is for v5.14 because it has
no risk of possibly changing the userspace's behavior).

Don't try to merge the cryptoloop module into the loop module now; it makes
backporting the fix difficult. After applying my patches, applying your PATCH 1,2,3/8
will be OK as a cleanup, and your PATCH 4/8 would be OK given that several weeks
of testing are done in linux-next tree. But never your PATCH 5,6,7,8/8. You can't
fix this problem now if you try to do a different thing together.



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux