mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Abhijit Pawar <abhi.c.pawar@gmail.com>
To: Joern Engel <joern@logfs.org>,
	Prasad Joshi <prasadjoshi.linux@gmail.com>,
	logfs@logfs.org
Cc: linux-kernel@vger.kernel.org, Abhijit Pawar <abhi.c.pawar@gmail.com>
Subject: [PATCH 2/2] fs: logfs NULL pointer check added
Date: Tue, 27 Nov 2012 16:55:58 +0530	[thread overview]
Message-ID: <1354015558-9030-1-git-send-email-abhi.c.pawar@gmail.com> (raw)

This patches fixes the case where the NULL inode may be passed to get the page for writing.

Signed-off-by: Abhijit Pawar <abhi.c.pawar@gmail.com>
---
 fs/logfs/readwrite.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/fs/logfs/readwrite.c b/fs/logfs/readwrite.c
index 53596ce..55b45fb 100644
--- a/fs/logfs/readwrite.c
+++ b/fs/logfs/readwrite.c
@@ -2201,6 +2201,7 @@ void btree_write_block(struct logfs_block *block)
 	int err, cookie;
 
 	inode = logfs_safe_iget(block->sb, block->ino, &cookie);
+	BUG_ON(!inode);
 	page = logfs_get_write_page(inode, block->bix, block->level);
 	BUG_ON(!page);
 
-- 
1.7.7.6


                 reply	other threads:[~2012-11-27 11:26 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1354015558-9030-1-git-send-email-abhi.c.pawar@gmail.com \
    --to=abhi.c.pawar@gmail.com \
    --cc=joern@logfs.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=logfs@logfs.org \
    --cc=prasadjoshi.linux@gmail.com \
    /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®