https://bugzilla.kernel.org/show_bug.cgi?id=32972 --- Comment #4 from Yongqiang Yang <xiaoqiangnk@xxxxxxxxx> 2011-04-11 01:50:38 --- On Mon, Apr 11, 2011 at 9:46 AM, Ted Ts'o <tytso@xxxxxxx> wrote: > On Sun, Apr 10, 2011 at 10:30:13PM +0800, Yongqiang Yang wrote: >> So the right code should beï >> >> Â Â Â bh->b_state = (bh->b_state & ~EXT4_MAP_FLAGS) | map.m_flags; >> Â Â Â map_bh(bh, inode->i_sb, map.m_pblk); >> Â Â Â if (buffer_unwritten(bh)) { >> Â Â Â Â Â Â Â /* A delayed write to unwritten bh should be marked >> Â Â Â Â Â Â Â Â* new and mapped. ÂMapped ensures that we don't do >> Â Â Â Â Â Â Â Â* get_block multiple times when we write to the same >> Â Â Â Â Â Â Â Â* offset and new ensures that we do proper zero out >> Â Â Â Â Â Â Â Â* for partial write. >> Â Â Â Â Â Â Â Â*/ >> Â Â Â Â Â Â Â set_buffer_new(bh); >> Â Â Â } > > Actually, I'm much more comfortable backing out commit 6de9843da > entirely. ÂThe above is *not* equivalent to what we had before --- > consider the case where ext4_map_blocks returns !EXT4_MAP_MAPPED && > !EXT4_MAP_UNWRITTEN. > > I don't *think* this should happen in the case where ext4_map_blocks > returns a value > 0, but the fact that it's not obvious, means I'd > much rather keep things the way that they are. ÂIt's not like dropping > the set_buffer_mapped(bh) was saving anything measurable anyway.... Agree. this way, the comment for unwritten case is also much clearer. Yongqiang > > Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â- Ted > -- Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching the assignee of the bug.-- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html