aboutsummaryrefslogtreecommitdiffstats
path: root/include/trace
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2009-11-23 07:17:05 -0500
committerTheodore Ts'o <tytso@mit.edu>2009-11-23 07:17:05 -0500
commite6362609b6c71c5b802026be9cf263bbdd67a50e (patch)
treebe908b6b0566f70d31378bf11b548a0d59ae0218 /include/trace
parent4433871130f36585fde38e7dd817433296648945 (diff)
ext4: call ext4_forget() from ext4_free_blocks()
Add the facility for ext4_forget() to be called from ext4_free_blocks(). This simplifies the code in a large number of places, and centralizes most of the work of calling ext4_forget() into a single place. Also fix a bug in the extents migration code; it wasn't calling ext4_forget() when releasing the indirect blocks during the conversion. As a result, if the system cashed during or shortly after the extents migration, and the released indirect blocks get reused as data blocks, the journal replay would corrupt the data blocks. With this new patch, fixing this bug was as simple as adding the EXT4_FREE_BLOCKS_FORGET flags to the call to ext4_free_blocks(). Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> Cc: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
Diffstat (limited to 'include/trace')
-rw-r--r--include/trace/events/ext4.h16
1 files changed, 9 insertions, 7 deletions
diff --git a/include/trace/events/ext4.h b/include/trace/events/ext4.h
index b390e1fc4a7b..74f628bfdd1b 100644
--- a/include/trace/events/ext4.h
+++ b/include/trace/events/ext4.h
@@ -650,30 +650,32 @@ TRACE_EVENT(ext4_allocate_blocks,
650 650
651TRACE_EVENT(ext4_free_blocks, 651TRACE_EVENT(ext4_free_blocks,
652 TP_PROTO(struct inode *inode, __u64 block, unsigned long count, 652 TP_PROTO(struct inode *inode, __u64 block, unsigned long count,
653 int metadata), 653 int flags),
654 654
655 TP_ARGS(inode, block, count, metadata), 655 TP_ARGS(inode, block, count, flags),
656 656
657 TP_STRUCT__entry( 657 TP_STRUCT__entry(
658 __field( dev_t, dev ) 658 __field( dev_t, dev )
659 __field( ino_t, ino ) 659 __field( ino_t, ino )
660 __field( umode_t, mode )
660 __field( __u64, block ) 661 __field( __u64, block )
661 __field( unsigned long, count ) 662 __field( unsigned long, count )
662 __field( int, metadata ) 663 __field( int, flags )
663
664 ), 664 ),
665 665
666 TP_fast_assign( 666 TP_fast_assign(
667 __entry->dev = inode->i_sb->s_dev; 667 __entry->dev = inode->i_sb->s_dev;
668 __entry->ino = inode->i_ino; 668 __entry->ino = inode->i_ino;
669 __entry->mode = inode->i_mode;
669 __entry->block = block; 670 __entry->block = block;
670 __entry->count = count; 671 __entry->count = count;
671 __entry->metadata = metadata; 672 __entry->flags = flags;
672 ), 673 ),
673 674
674 TP_printk("dev %s ino %lu block %llu count %lu metadata %d", 675 TP_printk("dev %s ino %lu mode 0%o block %llu count %lu flags %d",
675 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, 676 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino,
676 __entry->block, __entry->count, __entry->metadata) 677 __entry->mode, __entry->block, __entry->count,
678 __entry->flags)
677); 679);
678 680
679TRACE_EVENT(ext4_sync_file, 681TRACE_EVENT(ext4_sync_file,