public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Yinghai Lu <yinghai@kernel.org>
To: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Kay Sievers <kay.sievers@vrfy.org>, Greg KH <gregkh@suse.de>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Linux-Scsi <linux-scsi@vger.kernel.org>
Subject: Re: [PATCH] scsi: ses check name in enclosure_component_register
Date: Tue, 28 Apr 2009 18:02:23 -0700	[thread overview]
Message-ID: <49F7A71F.5040709@kernel.org> (raw)
In-Reply-To: <1240964289.3380.73.camel@mulgrave.int.hansenpartnership.com>

James Bottomley wrote:
> On Tue, 2009-04-28 at 16:56 -0700, Yinghai Lu wrote:
>> James Bottomley wrote:
>>> On Mon, 2009-04-27 at 19:18 -0700, Yinghai Lu wrote:
>>>> dev_set_name will use sprintf to copy the name.
>>>> need to check if the name does valid.
>>>>
>>>> otherwise will error from device_add later.
>>> I think what you mean to say is that empty names aren't allowed in the
>>> device model.
>>>
>>>> Signed-off-by: Yinghai Lu <yinghai@kernel.org>
>>>>
>>>> diff --git a/drivers/misc/enclosure.c b/drivers/misc/enclosure.c
>>>> index 3cf61ec..68743a9 100644
>>>> --- a/drivers/misc/enclosure.c
>>>> +++ b/drivers/misc/enclosure.c
>>>> @@ -255,7 +255,7 @@ enclosure_component_register(struct enclosure_device *edev,
>>>>  	ecomp->number = number;
>>>>  	cdev = &ecomp->cdev;
>>>>  	cdev->parent = get_device(&edev->edev);
>>>> -	if (name)
>>>> +	if (name && name[0])
>>>>  		dev_set_name(cdev, name);
>>> Actually, I think this should become
>>>
>>> dev_set_name(cdev, "%s", name);
>>>
>>> as well, otherwise any name with a percent in it will get interpreted in
>>> ways we're not expecting at all.
>> i tried that it still failed.
> 
> I didn't say it was the fix to your problem.  I said on looking at the
> code it's another potential problem source.  Your problem is that
> filesystems don't support empty file names.

dev_set_name(cdev, name);

the name become fmt. 

YH


  reply	other threads:[~2009-04-29  1:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-28  2:18 [PATCH] scsi: ses check name in enclosure_component_register Yinghai Lu
2009-04-28 22:26 ` James Bottomley
2009-04-28 23:56   ` Yinghai Lu
2009-04-29  0:18     ` James Bottomley
2009-04-29  1:02       ` Yinghai Lu [this message]
2009-04-29  2:03         ` Matthew Wilcox
2009-04-29  3:33           ` Yinghai Lu
2009-04-29 11:08             ` Matthew Wilcox
2009-05-01  2:13               ` [PATCH] scsi: ses check name in enclosure_component_register -v2 Yinghai Lu

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=49F7A71F.5040709@kernel.org \
    --to=yinghai@kernel.org \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=akpm@linux-foundation.org \
    --cc=gregkh@suse.de \
    --cc=kay.sievers@vrfy.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    /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