2007-08-16 20:13:18

by Alan Stern

[permalink] [raw]
Subject: [PATCH] sysfs: don't warn on removal of a nonexistent binary file

This patch (as960) removes the error message and stack dump logged by
sysfs_remove_bin_file() when someone tries to remove a nonexistent
file. The warning doesn't seem to be needed, since none of the other
file-, symlink-, or directory-removal routines in sysfs complain in a
comparable way.

Signed-off-by: Alan Stern <[email protected]>

---

This is 2.6.23 material. The spurious error message can be triggered
by USB code added since 2.6.22, so it needs to be removed before the
final release.

Alan Stern



Index: usb-2.6/fs/sysfs/bin.c
===================================================================
--- usb-2.6.orig/fs/sysfs/bin.c
+++ usb-2.6/fs/sysfs/bin.c
@@ -248,12 +248,7 @@ int sysfs_create_bin_file(struct kobject

void sysfs_remove_bin_file(struct kobject * kobj, struct bin_attribute * attr)
{
- if (sysfs_hash_and_remove(kobj->sd, attr->attr.name) < 0) {
- printk(KERN_ERR "%s: "
- "bad dentry or inode or no such file: \"%s\"\n",
- __FUNCTION__, attr->attr.name);
- dump_stack();
- }
+ sysfs_hash_and_remove(kobj->sd, attr->attr.name);
}

EXPORT_SYMBOL_GPL(sysfs_create_bin_file);


2007-08-17 01:20:53

by Tejun Heo

[permalink] [raw]
Subject: Re: [PATCH] sysfs: don't warn on removal of a nonexistent binary file

Alan Stern wrote:
> This patch (as960) removes the error message and stack dump logged by
> sysfs_remove_bin_file() when someone tries to remove a nonexistent
> file. The warning doesn't seem to be needed, since none of the other
> file-, symlink-, or directory-removal routines in sysfs complain in a
> comparable way.
>
> Signed-off-by: Alan Stern <[email protected]>

Acked-by: Tejun Heo <[email protected]>

--
tejun

2007-08-17 07:57:10

by Cornelia Huck

[permalink] [raw]
Subject: Re: [PATCH] sysfs: don't warn on removal of a nonexistent binary file

On Fri, 17 Aug 2007 10:19:24 +0900,
Tejun Heo <[email protected]> wrote:

> Alan Stern wrote:
> > This patch (as960) removes the error message and stack dump logged by
> > sysfs_remove_bin_file() when someone tries to remove a nonexistent
> > file. The warning doesn't seem to be needed, since none of the other
> > file-, symlink-, or directory-removal routines in sysfs complain in a
> > comparable way.
> >
> > Signed-off-by: Alan Stern <[email protected]>
>
> Acked-by: Tejun Heo <[email protected]>

Acked-by: Cornelia Huck <[email protected]>