[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20150517175118.GI4489@thunk.org>
Date: Sun, 17 May 2015 13:51:18 -0400
From: Theodore Ts'o <tytso@....edu>
To: Xiaoguang Wang <wangxg.fnst@...fujitsu.com>
Cc: linux-ext4@...r.kernel.org
Subject: Re: [PATCH] ext4: issue WARN_ON_ONCE() if page gets truncated in
ext4_write_[da_]begin()
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@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists