On Thu, May 07, 2015 at 05:17:23PM +0800, Xiaoguang Wang wrote: > In ext4_write_[da_]begin(), when we get a page successfully by calling > grab_cache_page_write_begin(), then unless this page is truncated by > ext4_truncate_failed_write(), which is called when ext4_write_[da_]begin() > run into some errors, otherwise I think this page won't be truncated by > other kernel path because we're holding i_mutex. > > In this patch, if page is truncated by ext4_truncate_failed_write(), then > we just put it and call grab_cache_page_write_begin() again to get a new > page, then this check 'if (page->mapping != mapping)' won't be necessary. > We can remove this check, but according to Jan Kara's suggestion, we issue > WARN_ON_ONCE() here if page is truncated, that means something is wrong. > (Thanks to Jan Kara for his help) It would be helpful if the commit description explained why this change is a benefit. There's a very detailed explanation about why it's safe, but why do we need to release the page only to try again to grab it by jumping to retry_grab instead of retry_journal? What problem are you trying to solve? Thanks, regards, - Ted -- 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