lkml.org 
[lkml]   [2004]   [Mar]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] cowlinks v2
Jörn Engel <joern@wohnheim.fh-wedel.de> wrote:
>
> +static long fcntl_setcow(struct file *filp, unsigned long arg)
> +{
> + struct inode *inode = filp->f_dentry->d_inode;
> +
> + spin_lock(&inode->i_lock);
> + if (arg)
> + inode->i_flags |= S_COWLINK;
> + else
> + inode->i_flags &= ~S_COWLINK;
> + mark_inode_dirty_sync(inode);
> + spin_unlock(&inode->i_lock);
> + return 0;
> +}
> +

i_lock is an innermost lock. No locks should be taken inside i_lock.

Here, not only is inode_lock being taken inside i_lock but ->dirty_inode
may be called as well, and dirty_inode() may not be called under any
spinlock.

-
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/

\
 
 \ /
  Last update: 2005-03-22 14:01    [from the cache]
©2003-2011 Jasper Spaans