Re: File change notification

From: Javier Fernandez-Ivern (ivern_at_acm.org)
Date: 12/31/03

  • Next message: Roger Luethi: "Re: 2.6.0 performance problems"
    Date:	Wed, 31 Dec 2003 12:49:07 -0800
    To: rudi@lambda-computing.de
    
    

    Rüdiger Klaehn wrote:

    Rudiger, I've been reading your code to try and understand it, and I
    found one think I'm not so sure about:

    > +++ develop/fs/dnotify.c 2003-12-31 16:59:36.000000000 +0100
    > @@ -153,8 +153,9 @@
    > void dnotify_parent(struct dentry *dentry, unsigned long event)
    > {
    > struct dentry *parent;
    > -
    > spin_lock(&dentry->d_lock);
    > + /* call inotify for this dentry */
    > + inotify_dentrychange(dentry,event);

    ...

    > +/*
    > + * This function should be called when something changes about a dentry, such
    > + * as attributes, creating, deleting, renaming etc.
    > + */
    > +void inotify_dentrychange(struct dentry *dentry,unsigned long event)
    > +{
    > + in_info info;
    > + struct dentry *parent;
    > + memset(&info,0,sizeof(in_info));
    > + info.event=event;
    > + spin_lock(&dentry->d_lock);

    inotify_dentrychange() is called from dnotify_parent() with the
    dentry->d_lock spinlock held. However, it also tries to attain the
    spinlock. Wouldn't this deadlock? I thought spinlocks were not recursive.

    Please let me know if I'm not understanding this...I'm a locking newbie.

    -- 
    Javier Fernandez-Ivern
    -
    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/
    

  • Next message: Roger Luethi: "Re: 2.6.0 performance problems"

    Relevant Pages

    • Re: 2.6.4-rc1-mm1: queue-congestion-dm-implementation patch
      ... it must wait on an internal semaphore ... > problem is that the higher-level caller is holding a spinlock at the same ... reproduce it I can try a few things.. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [PATCH]: Clean up of __alloc_pages
      ... Not to mention that a spinlock is an atomic op (though that is getting ... cheaper these days) + 2 memory barriers. ... Send instant messages to your online friends http://au.messenger.yahoo.com ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: serial driver / tty issues
      ... we should drop the spinlock and re-acquire it afterwards. ... and eventually cancel the work queue. ... > won't call the ldisc functions after we've closed them down. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: Help tracking down problem --- endless loop in __find_get_block_slow
      ... That it's not stuck on a ... to reproduce using subfs on kernels ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [PATCH 1/2] pci: Block config access during BIST (resend)
      ... > the lock and thus force exclusive access to the cacheline. ... I reverted the patch to use a spinlock and added a comment. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)