Jan Kara 7f5aa21508 jbd2: Avoid possible NULL dereference in jbd2_journal_begin_ordered_truncate()
If we race with commit code setting i_transaction to NULL, we could
possibly dereference it.  Proper locking requires the journal pointer
(to access journal->j_list_lock), which we don't have.  So we have to
change the prototype of the function so that filesystem passes us the
journal pointer.  Also add a more detailed comment about why the
function jbd2_journal_begin_ordered_truncate() does what it does and
how it should be used.

Thanks to Dan Carpenter <error27@gmail.com> for pointing to the
suspitious code.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Acked-by: Joel Becker <joel.becker@oracle.com>
CC: linux-ext4@vger.kernel.org
CC: ocfs2-devel@oss.oracle.com
CC: mfasheh@suse.de
CC: Dan Carpenter <error27@gmail.com>
2009-02-10 11:15:34 -05:00
..
2009-01-05 08:34:20 -08:00
2009-01-05 08:34:20 -08:00
2009-01-05 08:40:32 -08:00
2007-10-16 09:42:58 -07:00
2009-01-08 08:31:14 -08:00
2009-01-22 13:15:54 +03:00
2008-10-13 13:57:57 -07:00
2008-10-13 13:57:57 -07:00
2008-02-03 17:33:42 +02:00
2009-01-05 08:40:34 -08:00
2008-10-13 17:02:44 -07:00
2008-10-13 13:57:57 -07:00
2008-01-25 15:05:46 -08:00
2009-01-05 08:40:32 -08:00