public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] jffs2: use mutex_is_locked() in __jffs2_flush_wbuf()
@ 2011-06-27 20:21 Alexey Khoroshilov
  2011-06-29  6:05 ` Artem Bityutskiy
  0 siblings, 1 reply; 2+ messages in thread
From: Alexey Khoroshilov @ 2011-06-27 20:21 UTC (permalink / raw)
  To: David Woodhouse; +Cc: linux-mtd, linux-kernel, Alexey Khoroshilov

Use a helper to test if a mutex is held instead of a hack with
mutex_trylock().

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
---
 fs/jffs2/wbuf.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/fs/jffs2/wbuf.c b/fs/jffs2/wbuf.c
index 4515bea..a10fb24 100644
--- a/fs/jffs2/wbuf.c
+++ b/fs/jffs2/wbuf.c
@@ -578,8 +578,7 @@ static int __jffs2_flush_wbuf(struct jffs2_sb_info *c, int pad)
 	if (!jffs2_is_writebuffered(c))
 		return 0;
 
-	if (mutex_trylock(&c->alloc_sem)) {
-		mutex_unlock(&c->alloc_sem);
+	if (!mutex_is_locked(&c->alloc_sem)) {
 		printk(KERN_CRIT "jffs2_flush_wbuf() called with alloc_sem not locked!\n");
 		BUG();
 	}
-- 
1.7.4.1

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

end of thread, other threads:[~2011-06-29  6:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-27 20:21 [PATCH] jffs2: use mutex_is_locked() in __jffs2_flush_wbuf() Alexey Khoroshilov
2011-06-29  6:05 ` Artem Bityutskiy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox