public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Zdenek Kabelac <zkabelac@redhat.com>
To: device-mapper development <dm-devel@redhat.com>
Cc: Greg KH <greg@kroah.com>,
	linux-kernel@vger.kernel.org, Alasdair G Kergon <agk@redhat.com>,
	Milan Broz <mbroz@redhat.com>
Subject: Re: [dm-devel] Re: dm: sysfs add empty release function to avoid debug	warning
Date: Thu, 17 Dec 2009 00:25:27 +0100	[thread overview]
Message-ID: <4B296C67.7040804@redhat.com> (raw)
In-Reply-To: <20091216174632.GA12473@kroah.com>

Dne 16.12.2009 18:46, Greg KH napsal(a):
> On Wed, Dec 16, 2009 at 05:32:21PM +0100, Zdenek Kabelac wrote:
>> Dne 16.12.2009 14:45, Greg KH napsal(a):
>>> On Wed, Dec 16, 2009 at 10:44:41AM +0100, Milan Broz wrote:
>>>> On 12/16/2009 01:47 AM, Greg KH wrote:
>>>>> On Tue, Dec 15, 2009 at 05:35:08PM +0000, James Bottomley wrote:
>>>>>> commit: d2bb7df8cac647b92f51fb84ae735771e7adbfa7
>>>>>> From: Milan Broz <mbroz@redhat.com>
>>>>>> Date: Thu, 10 Dec 2009 23:51:53 +0000
>>>>>> Subject: [PATCH] dm: sysfs add empty release function to avoid debug warning
>>>>>>
>>>>>> This patch just removes an unnecessary warning:
>>>>>>  kobject: 'dm': does not have a release() function,
>>>>>>  it is broken and must be fixed.
>>>>>>
>>>>>> The kobject is embedded in mapped device struct, so
>>>>>> code does not need to release memory explicitly here.
>>>>>
>>>>
>>>>> Please, this is totally and completly wrong.  And if you feel that it is
>>>>> needed, then your design is wrong and it needs to be fixed.
>>>>
>>>> There are several places in kernel, where kobject have not defined release
>>>> method. Yes, something is wrong here.
>>>
>>> Where are those instances, becides the use of static kobjects, which is
>>> being worked on?
>>>
>>> That still does not make this change acceptable, it is incorrect.
>>>
>>>> So quietly ignoring warning is ok? Why is not there BUG_ON(!release) then?
>>>
>>> I was trying to be nice and not crash your machine and give you the
>>> opportunity to fix it easily.
>>>
>>>> The sysfs attributes here just represents attributes of block device object,
>>>> this device is always removed before release here is called.
>>>
>>> Then why use a kobject at all?  Your reference counting will be all
>>> wrong if you use it incorrectly like this.
>>>
>>>> So if there is preferred to do another alloc/free, no problem.
>>>
>>> Please do.
>>>
>>> Also, with the addition of this patch, your comments for the kobject are
>>> now incorrect as well.
>>>
>>
>> Here is list of just some errors I get on my 2.6.32 linux kernel.
>> (error message itself is removed)
>> Messages are printed during module removal/reboot.
>>
>> 'aead' (ffffffffa017c050): does not have a release() function, it is broken
>> and must be fixed.
>> 'bridge'
>> 'cdrom'
> 
> <snip>
> 
> You will find that all of these are modules, right?  That's being worked
> on still.
> 

Yes - true in most cases - here are exceptions:

fill_kobj_path: path = '/devices/system/kvm/kvm0'
fill_kobj_path: path = '/devices/system/kvm'
fill_kobj_path: path = '/bus/sdio'
fill_kobj_path: path = '/bus/mmc'

Please note, these are only modules in use on my system in use - so there is
probably more of them...

Zdenek

      parent reply	other threads:[~2009-12-16 23:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200912151735.nBFHZ8XP018683@hera.kernel.org>
2009-12-16  0:47 ` dm: sysfs add empty release function to avoid debug warning Greg KH
2009-12-16  9:44   ` Milan Broz
2009-12-16 13:45     ` Greg KH
2009-12-16 16:32       ` [dm-devel] " Zdenek Kabelac
2009-12-16 17:46         ` Greg KH
2009-12-16 18:40           ` Milan Broz
2009-12-17  0:30             ` Greg KH
2009-12-17 15:43               ` Milan Broz
2009-12-22  5:31                 ` Greg KH
2009-12-16 23:25           ` Zdenek Kabelac [this message]

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=4B296C67.7040804@redhat.com \
    --to=zkabelac@redhat.com \
    --cc=agk@redhat.com \
    --cc=dm-devel@redhat.com \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mbroz@redhat.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox