lkml.org 
[lkml]   [2012]   [Jun]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: processes hung after sys_renameat, and 'missing' processes
    On Wed, Jun 06, 2012 at 08:29:14PM -0400, Dave Jones wrote:
    > void d_move(struct dentry *dentry, struct dentry *target)
    > {
    > write_seqlock(&rename_lock);
    > +
    > + BUG_ON(!spin_is_locked(&target->d_parent->d_lock));
    > +
    > + if (dentry->d_parent != NULL)
    > + BUG_ON(!spin_is_locked(&dentry->d_parent->d_lock));
    > +
    > __d_move(dentry, target);
    > write_sequnlock(&rename_lock);
    > }
    >
    >
    > To be clear, do you want me to try that with or without the reverts ?

    No. Not ->d_lock; ->d_inode->i_mutex. _That_ needs to be held for
    d_move() to be safe (and on cross-directory move you need ->s_vfs_rename_mutex
    as well). I'd do it with WARN_ON, BTW, and without the reverts - that
    way we'll have a clear indication if that code is stepped on.


    \
     
     \ /
      Last update: 2012-06-07 03:21    [from the cache]
    ©2003-2014 Jasper Spaans. hosted at Digital Ocean