[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20070530133329.4a10a892@gondolin.boeblingen.de.ibm.com>
Date: Wed, 30 May 2007 13:33:29 +0200
From: Cornelia Huck <cornelia.huck@...ibm.com>
To: Tejun Heo <htejun@...il.com>
Cc: gregkh@...e.de, dmitry.torokhov@...il.com, oneukum@...e.de,
rpurdie@...ys.net, stern@...land.harvard.edu, maneesh@...ibm.com,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 4/6] sysfs: use sysfs_lock to protect the sysfs_dirent
tree
On Tue, 29 May 2007 01:36:27 +0900,
Tejun Heo <htejun@...il.com> wrote:
> @@ -795,6 +822,8 @@ static int sysfs_readdir(struct file * f
> i++;
> /* fallthrough */
> default:
> + spin_lock(&sysfs_lock);
> +
> pos = &parent_sd->s_children;
> while (*pos != cursor)
> pos = &(*pos)->s_sibling;
> @@ -827,6 +856,8 @@ static int sysfs_readdir(struct file * f
> /* put cursor back in */
> cursor->s_sibling = *pos;
> *pos = cursor;
> +
> + spin_unlock(&sysfs_lock);
> }
> return 0;
> }
Here's the cause of the "sleeping function called" I saw. filldir() is
called under sysfs_lock, but calls copy_to_user()... This means you
can't use sysfs_lock for protection here.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists