* [PATCH] mm: Fix comment before truncate_setsize()
@ 2014-11-05 17:00 Jan Kara
2014-11-06 21:28 ` Dave Chinner
0 siblings, 1 reply; 2+ messages in thread
From: Jan Kara @ 2014-11-05 17:00 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-mm, linux-fsdevel, Jan Beulich, 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().
Reported-by: Jan Beulich <JBeulich@suse.com>
Signed-off-by: Jan Kara <jack@suse.cz>
---
mm/truncate.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/mm/truncate.c b/mm/truncate.c
index b248c0c8dcd1..ed33e8f811e9 100644
--- a/mm/truncate.c
+++ b/mm/truncate.c
@@ -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)
{
--
1.8.1.4
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] mm: Fix comment before truncate_setsize()
2014-11-05 17:00 [PATCH] mm: Fix comment before truncate_setsize() Jan Kara
@ 2014-11-06 21:28 ` Dave Chinner
0 siblings, 0 replies; 2+ messages in thread
From: Dave Chinner @ 2014-11-06 21:28 UTC (permalink / raw)
To: Jan Kara; +Cc: Andrew Morton, linux-mm, linux-fsdevel, Jan Beulich
On Wed, Nov 05, 2014 at 06:00:06PM +0100, Jan Kara wrote:
> 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().
>
> Reported-by: Jan Beulich <JBeulich@suse.com>
> Signed-off-by: Jan Kara <jack@suse.cz>
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.
--
Dave Chinner
david@fromorbit.com
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-11-06 21:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-05 17:00 [PATCH] mm: Fix comment before truncate_setsize() Jan Kara
2014-11-06 21:28 ` Dave Chinner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).