From 10d68dbe7e2349efd34819e42754880bca67b8d2 Mon Sep 17 00:00:00 2001 From: Alexey Khoroshilov Date: Mon, 5 Nov 2012 22:40:14 +0400 Subject: [PATCH] --- yaml --- r: 347177 b: refs/heads/master c: 2cbba75a56ea78e6876b4e2547a882f10b3fe72b h: refs/heads/master i: 347175: a5aba72e24c273ae3e9d20be11cb4e48d6501326 v: v3 --- [refs] | 2 +- trunk/fs/jffs2/nodemgmt.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index e43a5840b12a..03a4073cc78e 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: d68cbdd4fb04d2b756ad53c22f36943167b16340 +refs/heads/master: 2cbba75a56ea78e6876b4e2547a882f10b3fe72b diff --git a/trunk/fs/jffs2/nodemgmt.c b/trunk/fs/jffs2/nodemgmt.c index 0c96eb52c797..03310721712f 100644 --- a/trunk/fs/jffs2/nodemgmt.c +++ b/trunk/fs/jffs2/nodemgmt.c @@ -417,14 +417,16 @@ static int jffs2_do_reserve_space(struct jffs2_sb_info *c, uint32_t minsize, spin_unlock(&c->erase_completion_lock); ret = jffs2_prealloc_raw_node_refs(c, jeb, 1); - if (ret) - return ret; + /* Just lock it again and continue. Nothing much can change because we hold c->alloc_sem anyway. In fact, it's not entirely clear why we hold c->erase_completion_lock in the majority of this function... but that's a question for another (more caffeine-rich) day. */ spin_lock(&c->erase_completion_lock); + if (ret) + return ret; + waste = jeb->free_size; jffs2_link_node_ref(c, jeb, (jeb->offset + c->sector_size - waste) | REF_OBSOLETE,