Skip to contentSkip to conversation

mm: Remove false WARN_ON from pagecache_isize_extended()

PATCH RESEND In review Jan Kara 2 participants 2 messages Oct 27, 2014 – Oct 28, 2014

Subsystems (3)
lore
Share & tools
lore

Jan Kara

author maintainer
#0 lore raw

PATCH RESEND 1/1 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.

---
 mm/truncate.c | 1 -
 1 file changed, 1 deletion(-)

Ted can you please merge this patch? I originally sent this patch in a
reply to Fengguangs report and apparently you missed it. Thanks!

mm/truncate.c +0 -1
index 261eaf6e5a19..c646084e5eec 100644
@@ -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)
Signature · 1 line
1.8.1.4
#1 lore raw
Quoted 18 lines · Jan Kara

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.

---
 mm/truncate.c | 1 -
 1 file changed, 1 deletion(-)

Ted can you please merge this patch? I originally sent this patch in a
reply to Fengguangs report and apparently you missed it. Thanks!

mm/truncate.c +0 -0
index 261eaf6e5a19..c646084e5eec 100644

mm/truncate.c void pagecache_isize_extended(struct inode *inode, loff_t from, loff_t to) · line 760

Quoted 7 lines
mm/truncate.c +0 -1
@@ -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)

Jan, I'm going to pull this through the XFS tree seeing as nobody else seems to care about it. Should be upstream by the end of the week.

Cheers,

Dave.

Signature · 2 lines
Dave Chinner
[email protected]