Skip to contentSkip to conversation

mm: Fix comment before truncate_setsize()

PATCH In review Jan Kara 2 participants 2 messages Nov 5, 2014 – Nov 6, 2014

Subsystems (3)
lore
Share & tools
lore

Jan Kara

author maintainer
#0 lore raw

PATCH 1/1 mm: Fix comment before truncate_setsize()

XFS doesn't always hold i_mutex when calling truncate_setsize() and it uses a different lock to serialize truncates and writes. So fix the comment before truncate_setsize().

---
 mm/truncate.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
mm/truncate.c +3 -2
index b248c0c8dcd1..ed33e8f811e9 100644
@@ -715,8 +715,9 @@ EXPORT_SYMBOL(truncate_pagecache);
  * necessary) to @newsize. It will be typically be called from the filesystem's
  * setattr function when ATTR_SIZE is passed in.
  *
- * Must be called with inode_mutex held and before all filesystem specific
- * block truncation has been performed.
+ * Must be called with a lock serializing truncates and writes (generally
+ * i_mutex but e.g. xfs uses a different lock) and before all filesystem
+ * specific block truncation has been performed.
  */
 void truncate_setsize(struct inode *inode, loff_t newsize)
 {
Signature · 7 lines
1.8.1.4

--
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>
#1 lore raw
Quoted 6 lines · Jan Kara

XFS doesn't always hold i_mutex when calling truncate_setsize() and it uses a different lock to serialize truncates and writes. So fix the comment before truncate_setsize().

I'll pull this into the xfs tree with the other fix. SHould go to linus tomorrow morning now that I've got all the XFS issues that were holding it up sorted out.

Cheers,

Dave.

Signature · 8 lines
Dave Chinner
[email protected]

--
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>