Skip to contentSkip to conversation

vfs: remove might_sleep() from clear_inode()

PATCH Applied Shakeel Butt 2 participants 2 messages Nov 8, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vfs: remove might_sleep() from clear_inode()

Commit 7994e6f72543 ("vfs: Move waiting for inode writeback from end_writeback() to evict_inode()") removed inode_sync_wait() from end_writeback() and commit dbd5768f87ff ("vfs: Rename end_writeback() to clear_inode()") renamed end_writeback() to clear_inode(). After these patches there is no sleeping operation in clear_inode(). So, remove might_sleep() from it.

---
 fs/inode.c | 1 -
 1 file changed, 1 deletion(-)
fs/inode.c +0 -1
index d1e35b53bb23..528f3159b928 100644
@@ -497,7 +497,6 @@ EXPORT_SYMBOL(__remove_inode_hash);
 
 void clear_inode(struct inode *inode)
 {
-	might_sleep();
 	/*
 	 * We have to cycle tree_lock here because reclaim can be still in the
 	 * process of removing the last page (in __delete_from_page_cache())
Signature · 7 lines
2.15.0.403.gc27cc4dac6-goog

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
maintainer
#1 lore raw
Quoted 6 lines · Shakeel Butt

Commit 7994e6f72543 ("vfs: Move waiting for inode writeback from end_writeback() to evict_inode()") removed inode_sync_wait() from end_writeback() and commit dbd5768f87ff ("vfs: Rename end_writeback() to clear_inode()") renamed end_writeback() to clear_inode(). After these patches there is no sleeping operation in clear_inode(). So, remove might_sleep() from it.

Point, but... this is far from the worst annoyance in clear_inode(). Starting with "BUG_ON() under spin_lock_irq() is antisocial and not in a good way", of course, but that's not all - the whole cycling of ->tree_lock has already been done back in truncate_inode_pages_final() and we'd better have called that in all cases when ->i_data might have ever contained anything.

The whole thing looks bogus these days... I wonder if we should simply move the remaining paranoia into destroy_inode() and get rid of the I_CLEAR completely...

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>