From: Jan Kara Date: Wed, 29 Oct 2014 23:35:00 +0000 (+1100) Subject: mm: Remove false WARN_ON from pagecache_isize_extended() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f55fefd1a5a339b1bd08c120b93312d6eb64a9fb;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git mm: Remove false WARN_ON from pagecache_isize_extended() The WARN_ON checking whether i_mutex is held in pagecache_isize_extended() was wrong because some filesystems (e.g. XFS) use different locks for serialization of truncates / writes. So just remove the check. Signed-off-by: Jan Kara Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner --- diff --git a/mm/truncate.c b/mm/truncate.c index 261eaf6e5a19..c646084e5eec 100644 --- a/mm/truncate.c +++ b/mm/truncate.c @@ -755,7 +755,6 @@ void pagecache_isize_extended(struct inode *inode, loff_t from, loff_t to) struct page *page; pgoff_t index; - WARN_ON(!mutex_is_locked(&inode->i_mutex)); WARN_ON(to > inode->i_size); if (from >= to || bsize == PAGE_CACHE_SIZE)