linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Theodore Ts'o <tytso@mit.edu>
To: Namjae Jeon <linkinjeon@gmail.com>
Cc: linux-ext4@vger.kernel.org
Subject: Re: [v7] ext4: Add support FALLOC_FL_COLLAPSE_RANGE for fallocate
Date: Wed, 2 Apr 2014 12:42:58 -0400	[thread overview]
Message-ID: <20140402164258.GH6901@thunk.org> (raw)
In-Reply-To: <CAKYAXd-EO0pp=wz_Tg+2NEw9Nyu23sKXc-3n-fZUieES3+xt7w@mail.gmail.com>

Some final testing luckily caught a bug in your patch.  I'll fix it
up, but for future reference, it's important to check to see if the
handle is valid (i.e., we are not in no-journal mode) before using any
of the journalling functions.  Otherwise, you will crash if you try
using the code path when the file system does not have a journal.

BTW, I would strongly recommend using the automated regression test
system found at:

	git://git.kernel.org/pub/scm/fs/ext2/xfstests-bld.git

It finds these sorts of problems very quickly.  After you build a
kernel, running "kvm-xfstests -g quick" would have found the problem
very quickly.  The fastest reproducer for the bug that I found is:
"kvm-xfstests -c nojournal shared/001".

Cheers,

						- Ted

diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 7015917..bbba1ef 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -4902,6 +4902,9 @@ ext4_access_path(handle_t *handle, struct inode *inode,
 {
 	int credits, err;
 
+	if (!ext4_handle_valid(handle))
+		return 0;
+
 	/*
 	 * Check if need to extend journal credits
 	 * 3 for leaf, sb, and inode plus 2 (bmap and group



  parent reply	other threads:[~2014-04-02 16:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-02 14:12 [PATCH v7] ext4: Add support FALLOC_FL_COLLAPSE_RANGE for fallocate Namjae Jeon
2014-03-16  3:17 ` [v7] " tytso
     [not found]   ` <CAKYAXd-EO0pp=wz_Tg+2NEw9Nyu23sKXc-3n-fZUieES3+xt7w@mail.gmail.com>
2014-04-02 16:42     ` Theodore Ts'o [this message]
2014-04-03 13:29       ` Namjae Jeon
2014-04-08 10:55       ` Dave Chinner
2014-04-08 13:40         ` Theodore Ts'o

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=20140402164258.GH6901@thunk.org \
    --to=tytso@mit.edu \
    --cc=linkinjeon@gmail.com \
    --cc=linux-ext4@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;
as well as URLs for NNTP newsgroup(s).