Fwd: Possible deadlock in vfs layer, namei.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 3/1/06, Al Viro <[email protected]> wrote:
> On Wed, Mar 01, 2006 at 06:46:42PM -0800, Joshua Hudson wrote:
> > I've been hunting down various deadlocks caused by hard links to directories.
> > I found one that can happen *without* such things.
>
> > process 1 does: rename("dir/subdir/file", "dir/file")
> > process 2 does: rmdir("dir/subdir")
> >
> > from namei.c (function: lock_rename), rename takes:
> > 1. s_vfs_rename_sem,
> > 2. dir/subdir: p1->d_inode->i_sem
> > 3. dir: p2->d_inode->i_sem
>
> No, it doesn't.  Wrong order - it will take dir before dir/subdir.
> RTFM - Documentation/filesystems/directory-locking is there for
> purpose.
>
Well, bloody stupid of me, didn't notice the slight differences of the
locking in the for loops.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux