mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Andreas Rohner <andreas.rohner@gmx.net>,
	linux-kernel@vger.kernel.org, linux-nilfs@vger.kernel.org
Subject: Re: [PATCH 3/4] nilfs2: add nilfs_sufile_set_suinfo to update segment usage
Date: Wed, 05 Feb 2014 02:23:09 +0900 (JST)	[thread overview]
Message-ID: <20140205.022309.85397785.konishi.ryusuke@lab.ntt.co.jp> (raw)
In-Reply-To: <20140205.014137.417300930.konishi.ryusuke@lab.ntt.co.jp>

On Wed, 05 Feb 2014 01:41:37 +0900 (JST), Ryusuke Konishi wrote:
> On Mon, 3 Feb 2014 13:38:18 -0800, Andrew Morton wrote:
>> On Tue,  4 Feb 2014 01:50:43 +0900 Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> wrote:
>> 
>>> From: Andreas Rohner <andreas.rohner@gmx.net>
>>> 
>>> This patch introduces the nilfs_sufile_set_suinfo function, which
>>> expects an array of nilfs_suinfo_update structures and updates the
>>> segment usage information accordingly.
>>> 
>>> This is basically a helper function for the newly introduced
>>> NILFS_IOCTL_SET_SUINFO ioctl.
>>> 
>>> ..
>>> +		sup = (void *)sup + supsz;
>>> +		if (sup >= supend)
>>> +			break;
>>> +
>>> +		prev_blkoff = blkoff;
>>> +		blkoff = nilfs_sufile_get_blkoff(sufile, sup->sup_segnum);
>>> +		if (blkoff == prev_blkoff)
>>> +			continue;
>>> +
>>> +		/* get different block */
>>> +		mark_buffer_dirty(bh);
>>> +		brelse(bh);
>> 
>> put_bh() will suffice - we know bh != NULL.
> 
> Agreed.  I will fix it later.

Here is the fix.

Ryusuke Konishi
--
From: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Subject: [PATCH] nilfs2: add nilfs_sufile_set_suinfo to update segment usage
 fix

Use put_bh() instead of brelse() because we know bh != NULL.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
---
 fs/nilfs2/sufile.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/nilfs2/sufile.c b/fs/nilfs2/sufile.c
index c37b5f0..5628b99 100644
--- a/fs/nilfs2/sufile.c
+++ b/fs/nilfs2/sufile.c
@@ -978,13 +978,13 @@ ssize_t nilfs_sufile_set_suinfo(struct inode *sufile, void *buf,
 
 		/* get different block */
 		mark_buffer_dirty(bh);
-		brelse(bh);
+		put_bh(bh);
 		ret = nilfs_mdt_get_block(sufile, blkoff, 1, NULL, &bh);
 		if (unlikely(ret < 0))
 			goto out_mark;
 	}
 	mark_buffer_dirty(bh);
-	brelse(bh);
+	put_bh(bh);
 
  out_mark:
 	if (ncleaned || ndirtied) {
@@ -994,7 +994,7 @@ ssize_t nilfs_sufile_set_suinfo(struct inode *sufile, void *buf,
 	}
 	nilfs_mdt_mark_dirty(sufile);
  out_header:
-	brelse(header_bh);
+	put_bh(header_bh);
  out_sem:
 	up_write(&NILFS_MDT(sufile)->mi_sem);
 	return ret;
-- 
1.7.9.3



  reply	other threads:[~2014-02-04 17:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-03 16:50 [PATCH 0/4] nilfs2 updates Ryusuke Konishi
2014-02-03 16:50 ` [PATCH 1/4] nilfs2: update MAINTAINERS file entries Ryusuke Konishi
2014-02-03 16:50 ` [PATCH 2/4] nilfs2: add struct nilfs_suinfo_update and flags Ryusuke Konishi
2014-02-03 16:50 ` [PATCH 3/4] nilfs2: add nilfs_sufile_set_suinfo to update segment usage Ryusuke Konishi
2014-02-03 21:38   ` Andrew Morton
2014-02-04 16:41     ` Ryusuke Konishi
2014-02-04 17:23       ` Ryusuke Konishi [this message]
2014-02-03 16:50 ` [PATCH 4/4] nilfs2: implementation of NILFS_IOCTL_SET_SUINFO ioctl Ryusuke Konishi
2014-02-03 21:41   ` Andrew Morton
2014-02-04  1:47     ` Ryusuke Konishi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140205.022309.85397785.konishi.ryusuke@lab.ntt.co.jp \
    --to=konishi.ryusuke@lab.ntt.co.jp \
    --cc=akpm@linux-foundation.org \
    --cc=andreas.rohner@gmx.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nilfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®