From: Jens Axboe <axboe@suse.de>
To: Paul Larson <plars@linuxtestproject.org>,
lkml <linux-kernel@vger.kernel.org>
Subject: Re: writing to sysfs appears to hang
Date: Tue, 19 Nov 2002 18:02:05 +0100 [thread overview]
Message-ID: <20021119170205.GC11884@suse.de> (raw)
In-Reply-To: <20021116004723.GB3153@beaverton.ibm.com>
On Fri, Nov 15 2002, Mike Anderson wrote:
> Paul Larson [plars@linuxtestproject.org] wrote:
> > I've been playing with sysfs and notices something odd. If I do this:
> > echo 1 > /sys/devices/sys/name
> > the process appears to be hung. ^c won't return control to me. If I
> > log in on another console though, I can't find it running in the process
> > list. All I can do is kill the login process. No kernel errors when I
> > do this, just the hung terminal.
> >
> > -Paul Larson
>
> I repeated your example and in a quick look at the backtrace
> the echo is in a loop calling down into sysfs_write_file/dev_attr_store.
>
> I think the problem is that if a device does not have a attribute store
> function the return value from dev_attr_store is incorrect.
This has been in the deadline-rbtree patches for some time (uses writes
to sysfs, too).
===== fs/sysfs/inode.c 1.59 vs edited =====
--- 1.59/fs/sysfs/inode.c Wed Oct 30 21:27:35 2002
+++ edited/fs/sysfs/inode.c Fri Nov 8 14:33:59 2002
@@ -243,7 +243,7 @@
if (kobj && kobj->subsys)
ops = kobj->subsys->sysfs_ops;
if (!ops || !ops->store)
- return 0;
+ return -EINVAL;
page = (char *)__get_free_page(GFP_KERNEL);
if (!page)
--
Jens Axboe
next prev parent reply other threads:[~2002-11-19 16:55 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-11-15 23:00 writing to sysfs appears to hang Paul Larson
2002-11-16 0:47 ` Mike Anderson
2002-11-19 17:02 ` Jens Axboe [this message]
2002-11-20 17:24 ` Paul Larson
2002-11-20 19:14 ` Jens Axboe
2002-11-20 19:33 ` Patrick Mochel
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=20021119170205.GC11884@suse.de \
--to=axboe@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=plars@linuxtestproject.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