[PATCH v3 0/3] blk-integrity: drop integrity_kobj from gendisk

Thomas Weißschuh posted 3 patches 1 year, 1 month ago
block/blk-integrity.c  | 175 +++++++++++++++++--------------------------------
block/blk.h            |  10 +--
block/genhd.c          |  12 ++--
include/linux/blkdev.h |   3 -
4 files changed, 66 insertions(+), 134 deletions(-)
[PATCH v3 0/3] blk-integrity: drop integrity_kobj from gendisk
Posted by Thomas Weißschuh 1 year, 1 month ago
The embedded member integrity_kobj member of struct gendisk violates
the assumption of the driver core that only one struct kobject should be
embedded into another object and then manages its lifetime.

As the integrity_kobj is only used to hold a few sysfs attributes it can
be replaced by direct device_attributes and removed.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
Changes in v3:
- Style cleanups
- Register attributes directly via disk_attr_groups
- Link to v2: https://lore.kernel.org/r/20230309-kobj_release-gendisk_integrity-v2-0-761a50d71900@weissschuh.net

Changes in v2:
- Get rid of integrity_kobj completely
- Migrate to sysfs_emit helper
- Link to v1: https://lore.kernel.org/r/20230309-kobj_release-gendisk_integrity-v1-1-a240f54eac60@weissschuh.net

---
Thomas Weißschuh (3):
      blk-integrity: use sysfs_emit
      blk-integrity: convert to struct device_attribute
      blk-integrity: register sysfs attributes on struct device

 block/blk-integrity.c  | 175 +++++++++++++++++--------------------------------
 block/blk.h            |  10 +--
 block/genhd.c          |  12 ++--
 include/linux/blkdev.h |   3 -
 4 files changed, 66 insertions(+), 134 deletions(-)
---
base-commit: 478a351ce0d69cef2d2bf2a686a09b356b63a66c
change-id: 20230309-kobj_release-gendisk_integrity-e26c0bc126aa

Best regards,
-- 
Thomas Weißschuh <linux@weissschuh.net>

Re: [PATCH v3 0/3] blk-integrity: drop integrity_kobj from gendisk
Posted by Jens Axboe 11 months, 3 weeks ago
On Sat, 18 Mar 2023 17:36:22 +0000, Thomas Weißschuh wrote:
> The embedded member integrity_kobj member of struct gendisk violates
> the assumption of the driver core that only one struct kobject should be
> embedded into another object and then manages its lifetime.
> 
> As the integrity_kobj is only used to hold a few sysfs attributes it can
> be replaced by direct device_attributes and removed.
> 
> [...]

Applied, thanks!

[1/3] blk-integrity: use sysfs_emit
      commit: 3315e169b446249c1b61ff988d157238f4b2c5a0
[2/3] blk-integrity: convert to struct device_attribute
      commit: 76b8c319f02715e14abdbbbdd6508e83a1059bcc
[3/3] blk-integrity: register sysfs attributes on struct device
      commit: ff53cd52d9bdbf4074d2bbe9b591729997780bd3

Best regards,
-- 
Jens Axboe



Re: [PATCH v3 0/3] blk-integrity: drop integrity_kobj from gendisk
Posted by Martin K. Petersen 1 year, 1 month ago
Thomas,

> The embedded member integrity_kobj member of struct gendisk violates
> the assumption of the driver core that only one struct kobject should
> be embedded into another object and then manages its lifetime.
>
> As the integrity_kobj is only used to hold a few sysfs attributes it
> can be replaced by direct device_attributes and removed.

Looks good to me and passed a quick test on a couple of systems. Thanks
for cleaning this up!

Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>

-- 
Martin K. Petersen	Oracle Linux Engineering
Re: [PATCH v3 0/3] blk-integrity: drop integrity_kobj from gendisk
Posted by Thomas Weißschuh 11 months, 3 weeks ago
Hi Martin, Christoph, Jens,

On 2023-03-20 07:56:58-0400, Martin K. Petersen wrote:
> > The embedded member integrity_kobj member of struct gendisk violates
> > the assumption of the driver core that only one struct kobject should
> > be embedded into another object and then manages its lifetime.
> >
> > As the integrity_kobj is only used to hold a few sysfs attributes it
> > can be replaced by direct device_attributes and removed.
> 
> Looks good to me and passed a quick test on a couple of systems. Thanks
> for cleaning this up!
> 
> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>

Am I getting some part of the process for block/ wrong?

It seems my patches for the block subsystem are having a hard time
getting merged.

* https://lore.kernel.org/all/20221110052438.2188-1-linux@weissschuh.net/
* this series
* https://lore.kernel.org/all/20230419-const-partition-v2-0-817b58f85cd1@weissschuh.net/

Thanks for any pointers,
Thomas
Re: [PATCH v3 0/3] blk-integrity: drop integrity_kobj from gendisk
Posted by Jens Axboe 11 months, 3 weeks ago
On 4/26/23 5:12?PM, Thomas Wei?schuh wrote:
> Hi Martin, Christoph, Jens,
> 
> On 2023-03-20 07:56:58-0400, Martin K. Petersen wrote:
>>> The embedded member integrity_kobj member of struct gendisk violates
>>> the assumption of the driver core that only one struct kobject should
>>> be embedded into another object and then manages its lifetime.
>>>
>>> As the integrity_kobj is only used to hold a few sysfs attributes it
>>> can be replaced by direct device_attributes and removed.
>>
>> Looks good to me and passed a quick test on a couple of systems. Thanks
>> for cleaning this up!
>>
>> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
> 
> Am I getting some part of the process for block/ wrong?

Sorry, I missed this series. I'll queue it up for 6.4.

> It seems my patches for the block subsystem are having a hard time
> getting merged.
> 
> * https://lore.kernel.org/all/20221110052438.2188-1-linux@weissschuh.net/

This one is missing nbd review. It's unfortunately not uncommon to need
to re-ping on something like this, if you don't get a timely review.
This is not specific to this patch, just in general. Things get missed.

> * this series
> * https://lore.kernel.org/all/20230419-const-partition-v2-0-817b58f85cd1@weissschuh.net/

This one is just a week old, and coming into the merge window. Generally
takes longer at that time, as it's late for that merge window, and folks
are busy with getting things ready. If nothing happens on this one, I'd
suggest resending past -rc1 when folks are more ready to review and
queue things up for the next release.

-- 
Jens Axboe
Re: [PATCH v3 0/3] blk-integrity: drop integrity_kobj from gendisk
Posted by Thomas Weißschuh 11 months, 3 weeks ago
On 2023-04-26 18:26:11-0600, Jens Axboe wrote:
> On 4/26/23 5:12?PM, Thomas Wei?schuh wrote:
> > Hi Martin, Christoph, Jens,
> > 
> > On 2023-03-20 07:56:58-0400, Martin K. Petersen wrote:
> >>> The embedded member integrity_kobj member of struct gendisk violates
> >>> the assumption of the driver core that only one struct kobject should
> >>> be embedded into another object and then manages its lifetime.
> >>>
> >>> As the integrity_kobj is only used to hold a few sysfs attributes it
> >>> can be replaced by direct device_attributes and removed.
> >>
> >> Looks good to me and passed a quick test on a couple of systems. Thanks
> >> for cleaning this up!
> >>
> >> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
> > 
> > Am I getting some part of the process for block/ wrong?
> 
> Sorry, I missed this series. I'll queue it up for 6.4.

Thanks!

> > It seems my patches for the block subsystem are having a hard time
> > getting merged.
> > 
> > * https://lore.kernel.org/all/20221110052438.2188-1-linux@weissschuh.net/
> 
> This one is missing nbd review. It's unfortunately not uncommon to need
> to re-ping on something like this, if you don't get a timely review.
> This is not specific to this patch, just in general. Things get missed.

Will do.

> > * this series
> > * https://lore.kernel.org/all/20230419-const-partition-v2-0-817b58f85cd1@weissschuh.net/
> 
> This one is just a week old, and coming into the merge window. Generally
> takes longer at that time, as it's late for that merge window, and folks
> are busy with getting things ready. If nothing happens on this one, I'd
> suggest resending past -rc1 when folks are more ready to review and
> queue things up for the next release.

Indeed, it is only listed for completeness sake.

I assumed that because all three series were like this, that I maybe
missed some PATCH prefix for your filter, managed to end up in your
killfile or mails from my privately managed mailservers don't get
through.

This is why I also wrote to Martin and Christoph, fearing that you don't
see my mails.

Thanks for the clarification,
Thomas