Re: [PATCH] 2.5.46: access permission filesystem

Andrew Morton (akpm@digeo.com)
Sun, 10 Nov 2002 18:27:31 -0800


Olaf Dietsche wrote:
>
> Ben Clifford <benc@hawaga.org.uk> writes:
>
> > I still get those stack traces, though...
>
> I retested with CONFIG_PREEMPT=y and now I get those stack traces,
> too. So, it seems my code is not preempt safe.
>

It's not that your code is unsafe with preemption. It's just that
CONFIG_PREEMPT=y turns on the debugging infrastructure which allows
us to detect things like calling kmalloc(GFP_KERNEL) inside spinlock.

+static int accessfs_node_init(struct accessfs_direntry *parent, struct accessfs_entry *de, const char *name, size_t len, struct access_attr *attr, mode_t mode
+{
+ static unsigned long ino = 1;
+ de->name = kmalloc(len + 1, GFP_KERNEL);
+ ...
+
+static int accessfs_mknod(struct accessfs_direntry *dir, const char *name, struct access_attr *attr)
+{
+ ...
+ spin_lock(&accessfs_lock);
+ accessfs_node_init(dir, pe, name, strlen(name), attr, S_IFREG | attr->mo
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/