[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140402164258.GH6901@thunk.org>
Date: Wed, 2 Apr 2014 12:42:58 -0400
From: Theodore Ts'o <tytso@....edu>
To: Namjae Jeon <linkinjeon@...il.com>
Cc: linux-ext4@...r.kernel.org
Subject: Re: [v7] ext4: Add support FALLOC_FL_COLLAPSE_RANGE for fallocate
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
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists