Re: [PATCH] de-semaphorize smackfs

From: Daniel Walker
Date: Wed Mar 19 2008 - 15:28:55 EST



On Mon, 2008-03-17 at 17:14 -0600, Jonathan Corbet wrote:

> @@ -171,7 +171,7 @@ static int smk_open_load(struct inode *inode, struct file *file)
> if ((file->f_flags & O_ACCMODE) == O_RDONLY)
> return seq_open(file, &load_seq_ops);
>
> - if (down_interruptible(&smack_write_sem))
> + if (mutex_lock_interruptible(&smack_write_mutex))
> return -ERESTARTSYS;
>
> return 0;

There's a disconnect between the lock unlock calls, when the locking
application returns to userspace. Mutex's have a restriction that you
can't return to userspace while holding the lock.

Daniel

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/