linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [mmotm:master 64/350] fs/ocfs2/dlmglue.c:3184 ocfs2_mark_lockres_freeing() error: double lock 'irqsave:flags'
@ 2014-02-26 10:48 Dan Carpenter
  2014-02-26 11:02 ` Jan Kara
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2014-02-26 10:48 UTC (permalink / raw)
  To: kbuild, Jan Kara; +Cc: Dan Carpenter, Linux Memory Management List

[ False positive, this is not a bug, it's just that the second IRQ save
  is unnecessary ].

Hi Jan,

FYI, there are new smatch warnings show up in

tree:   git://git.cmpxchg.org/linux-mmotm.git master
head:   a6a1126d3535f0bd8d7c56810061541a4f5595af
commit: c8acdd9e9cf2dd5a5f62034dfaf93c721b3f405d [64/350] ocfs2: avoid blocking in ocfs2_mark_lockres_freeing() in downconvert thread

fs/ocfs2/dlmglue.c:3184 ocfs2_mark_lockres_freeing() error: double lock 'irqsave:flags'
fs/ocfs2/dlmglue.c:3204 ocfs2_mark_lockres_freeing() error: double unlock 'irqsave:flags'

git remote add mmotm git://git.cmpxchg.org/linux-mmotm.git
git remote update mmotm
git checkout c8acdd9e9cf2dd5a5f62034dfaf93c721b3f405d
vim +3184 fs/ocfs2/dlmglue.c

c8acdd9e Jan Kara    2014-02-25  3178  		 *             ocfs2_clear_inode()
c8acdd9e Jan Kara    2014-02-25  3179  		 *               ocfs2_mark_lockres_freeing()
c8acdd9e Jan Kara    2014-02-25  3180  		 *                 ... blocks waiting for OCFS2_LOCK_QUEUED
c8acdd9e Jan Kara    2014-02-25  3181  		 *                 since we are the downconvert thread which
c8acdd9e Jan Kara    2014-02-25  3182  		 *                 should clear the flag.
c8acdd9e Jan Kara    2014-02-25  3183  		 */
c8acdd9e Jan Kara    2014-02-25 @3184  		spin_lock_irqsave(&osb->dc_task_lock, flags);
c8acdd9e Jan Kara    2014-02-25  3185  		list_del_init(&lockres->l_blocked_list);
c8acdd9e Jan Kara    2014-02-25  3186  		osb->blocked_lock_count--;
c8acdd9e Jan Kara    2014-02-25  3187  		spin_unlock_irqrestore(&osb->dc_task_lock, flags);
c8acdd9e Jan Kara    2014-02-25  3188  		lockres_clear_flags(lockres, OCFS2_LOCK_QUEUED);
c8acdd9e Jan Kara    2014-02-25  3189  		goto out_unlock;
c8acdd9e Jan Kara    2014-02-25  3190  	}
ccd979bd Mark Fasheh 2005-12-15  3191  	while (lockres->l_flags & OCFS2_LOCK_QUEUED) {
ccd979bd Mark Fasheh 2005-12-15  3192  		lockres_add_mask_waiter(lockres, &mw, OCFS2_LOCK_QUEUED, 0);
ccd979bd Mark Fasheh 2005-12-15  3193  		spin_unlock_irqrestore(&lockres->l_lock, flags);
ccd979bd Mark Fasheh 2005-12-15  3194  
ccd979bd Mark Fasheh 2005-12-15  3195  		mlog(0, "Waiting on lockres %s\n", lockres->l_name);
ccd979bd Mark Fasheh 2005-12-15  3196  
ccd979bd Mark Fasheh 2005-12-15  3197  		status = ocfs2_wait_for_mask(&mw);
ccd979bd Mark Fasheh 2005-12-15  3198  		if (status)
ccd979bd Mark Fasheh 2005-12-15  3199  			mlog_errno(status);
ccd979bd Mark Fasheh 2005-12-15  3200  
ccd979bd Mark Fasheh 2005-12-15  3201  		spin_lock_irqsave(&lockres->l_lock, flags);
ccd979bd Mark Fasheh 2005-12-15  3202  	}
c8acdd9e Jan Kara    2014-02-25  3203  out_unlock:
ccd979bd Mark Fasheh 2005-12-15 @3204  	spin_unlock_irqrestore(&lockres->l_lock, flags);
ccd979bd Mark Fasheh 2005-12-15  3205  }
ccd979bd Mark Fasheh 2005-12-15  3206  
d680efe9 Mark Fasheh 2006-09-08  3207  void ocfs2_simple_drop_lockres(struct ocfs2_super *osb,

---
0-DAY kernel build testing backend              Open Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild                 Intel Corporation

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [mmotm:master 64/350] fs/ocfs2/dlmglue.c:3184 ocfs2_mark_lockres_freeing() error: double lock 'irqsave:flags'
  2014-02-26 10:48 [mmotm:master 64/350] fs/ocfs2/dlmglue.c:3184 ocfs2_mark_lockres_freeing() error: double lock 'irqsave:flags' Dan Carpenter
@ 2014-02-26 11:02 ` Jan Kara
  0 siblings, 0 replies; 2+ messages in thread
From: Jan Kara @ 2014-02-26 11:02 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: kbuild, Jan Kara, Linux Memory Management List

  Hi,

On Wed 26-02-14 13:48:35, Dan Carpenter wrote:
> [ False positive, this is not a bug, it's just that the second IRQ save
>   is unnecessary ].
> FYI, there are new smatch warnings show up in
> 
> tree:   git://git.cmpxchg.org/linux-mmotm.git master
> head:   a6a1126d3535f0bd8d7c56810061541a4f5595af
> commit: c8acdd9e9cf2dd5a5f62034dfaf93c721b3f405d [64/350] ocfs2: avoid blocking in ocfs2_mark_lockres_freeing() in downconvert thread
> 
> fs/ocfs2/dlmglue.c:3184 ocfs2_mark_lockres_freeing() error: double lock 'irqsave:flags'
> fs/ocfs2/dlmglue.c:3204 ocfs2_mark_lockres_freeing() error: double unlock 'irqsave:flags'
  Yeah. I actually have an updated version of a patch which doesn't have
these two nested irqsafe calls. I'll send it to Andrew. Thanks for letting
me know.

									Honza


> git remote add mmotm git://git.cmpxchg.org/linux-mmotm.git
> git remote update mmotm
> git checkout c8acdd9e9cf2dd5a5f62034dfaf93c721b3f405d
> vim +3184 fs/ocfs2/dlmglue.c
> 
> c8acdd9e Jan Kara    2014-02-25  3178  		 *             ocfs2_clear_inode()
> c8acdd9e Jan Kara    2014-02-25  3179  		 *               ocfs2_mark_lockres_freeing()
> c8acdd9e Jan Kara    2014-02-25  3180  		 *                 ... blocks waiting for OCFS2_LOCK_QUEUED
> c8acdd9e Jan Kara    2014-02-25  3181  		 *                 since we are the downconvert thread which
> c8acdd9e Jan Kara    2014-02-25  3182  		 *                 should clear the flag.
> c8acdd9e Jan Kara    2014-02-25  3183  		 */
> c8acdd9e Jan Kara    2014-02-25 @3184  		spin_lock_irqsave(&osb->dc_task_lock, flags);
> c8acdd9e Jan Kara    2014-02-25  3185  		list_del_init(&lockres->l_blocked_list);
> c8acdd9e Jan Kara    2014-02-25  3186  		osb->blocked_lock_count--;
> c8acdd9e Jan Kara    2014-02-25  3187  		spin_unlock_irqrestore(&osb->dc_task_lock, flags);
> c8acdd9e Jan Kara    2014-02-25  3188  		lockres_clear_flags(lockres, OCFS2_LOCK_QUEUED);
> c8acdd9e Jan Kara    2014-02-25  3189  		goto out_unlock;
> c8acdd9e Jan Kara    2014-02-25  3190  	}
> ccd979bd Mark Fasheh 2005-12-15  3191  	while (lockres->l_flags & OCFS2_LOCK_QUEUED) {
> ccd979bd Mark Fasheh 2005-12-15  3192  		lockres_add_mask_waiter(lockres, &mw, OCFS2_LOCK_QUEUED, 0);
> ccd979bd Mark Fasheh 2005-12-15  3193  		spin_unlock_irqrestore(&lockres->l_lock, flags);
> ccd979bd Mark Fasheh 2005-12-15  3194  
> ccd979bd Mark Fasheh 2005-12-15  3195  		mlog(0, "Waiting on lockres %s\n", lockres->l_name);
> ccd979bd Mark Fasheh 2005-12-15  3196  
> ccd979bd Mark Fasheh 2005-12-15  3197  		status = ocfs2_wait_for_mask(&mw);
> ccd979bd Mark Fasheh 2005-12-15  3198  		if (status)
> ccd979bd Mark Fasheh 2005-12-15  3199  			mlog_errno(status);
> ccd979bd Mark Fasheh 2005-12-15  3200  
> ccd979bd Mark Fasheh 2005-12-15  3201  		spin_lock_irqsave(&lockres->l_lock, flags);
> ccd979bd Mark Fasheh 2005-12-15  3202  	}
> c8acdd9e Jan Kara    2014-02-25  3203  out_unlock:
> ccd979bd Mark Fasheh 2005-12-15 @3204  	spin_unlock_irqrestore(&lockres->l_lock, flags);
> ccd979bd Mark Fasheh 2005-12-15  3205  }
> ccd979bd Mark Fasheh 2005-12-15  3206  
> d680efe9 Mark Fasheh 2006-09-08  3207  void ocfs2_simple_drop_lockres(struct ocfs2_super *osb,
> 
> ---
> 0-DAY kernel build testing backend              Open Source Technology Center
> http://lists.01.org/mailman/listinfo/kbuild                 Intel Corporation
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-02-26 11:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-26 10:48 [mmotm:master 64/350] fs/ocfs2/dlmglue.c:3184 ocfs2_mark_lockres_freeing() error: double lock 'irqsave:flags' Dan Carpenter
2014-02-26 11:02 ` Jan Kara

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).