lkml.org 
[lkml]   [2008]   [Mar]   [19]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] de-semaphorize smackfs
FromDaniel Walker <>
DateTue, 18 Mar 2008 08:41:39 -0700
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



\
 
 \ /
  Last update: 2008-03-19 20:35    [from the cache]
©2003-2008