linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
From: Jaegeuk Kim <jaegeuk@kernel.org>
To: linux-f2fs-devel@lists.sourceforge.net
Cc: Jaegeuk Kim <jaegeuk@kernel.org>
Subject: [PATCH 2/2] fsck.f2fs: drop extent_info to avoid potential wrong access
Date: Mon,  6 Jul 2015 15:55:31 -0700	[thread overview]
Message-ID: <1436223331-29064-2-git-send-email-jaegeuk@kernel.org> (raw)
In-Reply-To: <1436223331-29064-1-git-send-email-jaegeuk@kernel.org>

This patch avoids wrong extent information modified by fixing block addresses.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
 fsck/fsck.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fsck/fsck.c b/fsck/fsck.c
index bbd4cab..70efce6 100644
--- a/fsck/fsck.c
+++ b/fsck/fsck.c
@@ -722,6 +722,8 @@ skip_blkcnt_fix:
 		}
 	}
 	if (need_fix) {
+		/* drop extent information to avoid potential wrong access */
+		node_blk->i.i_ext.len = 0;
 		ret = dev_write_block(node_blk, ni->blk_addr);
 		ASSERT(ret >= 0);
 	}
-- 
2.1.1


------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/

      reply	other threads:[~2015-07-06 22:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-06 22:55 [PATCH 1/2] fsck.f2fs: select to update the latest valid summary Jaegeuk Kim
2015-07-06 22:55 ` Jaegeuk Kim [this message]

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=1436223331-29064-2-git-send-email-jaegeuk@kernel.org \
    --to=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    /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;
as well as URLs for NNTP newsgroup(s).