From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vyacheslav Dubeyko Subject: Re: [PATCH v2 14/15] hfsplus: implement replay journal functionality Date: Wed, 05 Feb 2014 11:50:16 +0400 Message-ID: <1391586616.2590.11.camel@ubuntu> References: <1390577336.2287.88.camel@slavad-ubuntu-12.04> <20140204143301.a2c0cbe9ba5957cc86a2b1a6@linux-foundation.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: Linux FS devel list , Al Viro , ChristophHellwig , Hin-Tak Leung To: Andrew Morton Return-path: Received: from gproxy2-pub.mail.unifiedlayer.com ([69.89.18.3]:54425 "HELO gproxy2-pub.mail.unifiedlayer.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1750936AbaBEHux (ORCPT ); Wed, 5 Feb 2014 02:50:53 -0500 In-Reply-To: <20140204143301.a2c0cbe9ba5957cc86a2b1a6@linux-foundation.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Hi Andrew, On Tue, 2014-02-04 at 14:33 -0800, Andrew Morton wrote: > On Fri, 24 Jan 2014 19:28:56 +0400 Vyacheslav Dubeyko wrote: > > > From: Vyacheslav Dubeyko > > Subject: [PATCH v2 14/15] hfsplus: implement replay journal functionality > > > > This patch implements functionality of HFS+ journal replay. > > > > If the journal contains valid transaction then it needs to write > > them to disk. In order to replay the journal, an implementation > > just loops over the transactions, copying each individual block > > in the transaction from the journal to its proper location on > > the volume. Once those blocks have been flushed to the media > > (not just the driver!), it may update the journal header to > > remove the transactions. > > > > ... > > > > +static int hfsplus_replay_journal(struct super_block *sb) > > +{ > > + struct hfsplus_journal *jnl = HFSPLUS_SB(sb)->jnl; > > + struct hfsplus_journal_header *jh = jnl->jh; > > + struct hfsplus_blist_desc desc; > > + u32 last_seq_num = 0; > > + int err; > > + > > > > ... > > > > + if (hfsplus_journal_empty(jh)) > > + err = hfsplus_replay_journal_header(sb); > > + else { > > + pr_err("journal replay failed\n"); > > + err = -EIO; > > + } > > + > > + if (unlikely(err)) > > + goto failed_journal_replay; > > + > > + mutex_unlock(&jnl->jnl_lock); > > + hfsplus_deinit_block_list_desc(&desc); > > + return 0; > > umm, remove the above five statements? > > > +failed_journal_replay: > > + mutex_unlock(&jnl->jnl_lock); > > + hfsplus_deinit_block_list_desc(&desc); > > + return err; > > +} Yes, I agree. Please, find the patch below. Thanks, Vyacheslav Dubeyko. -- From: Vyacheslav Dubeyko Subject: [PATCH] hfsplus: remove unnecessary duplication of cleanup in hfsplus_replay_journal() method This patch simply remove unnecessary duplication of cleanup in hfsplus_replay_journal() method. Signed-off-by: Vyacheslav Dubeyko Cc: Hin-Tak Leung Cc: Al Viro Cc: Christoph Hellwig --- fs/hfsplus/journal.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/fs/hfsplus/journal.c b/fs/hfsplus/journal.c index 720d96a..93c1d6f 100644 --- a/fs/hfsplus/journal.c +++ b/fs/hfsplus/journal.c @@ -947,13 +947,6 @@ static int hfsplus_replay_journal(struct super_block *sb) err = -EIO; } - if (unlikely(err)) - goto failed_journal_replay; - - mutex_unlock(&jnl->jnl_lock); - hfsplus_deinit_block_list_desc(&desc); - return 0; - failed_journal_replay: mutex_unlock(&jnl->jnl_lock); hfsplus_deinit_block_list_desc(&desc); -- 1.7.9.5