From: "Jan Beulich" <JBeulich@suse.com>
To: "Jan Kara" <jack@suse.cz>
Cc: <david@fromorbit.com>, <xfs@oss.sgi.com>, <linux-kernel@vger.kernel.org>
Subject: your patch "mm: Remove false WARN_ON from pagecache_isize_extended()"
Date: Mon, 03 Nov 2014 16:41:13 +0000 [thread overview]
Message-ID: <5457BE390200007800044838@mail.emea.novell.com> (raw)
Jan,
having run into that warning too, I looked into it a little, and now
having found that patch am pretty uncertain: Both truncate_setsize()
and pagecache_isize_extended() document that they want to be
called with i_mutex held, so removing the WARN_ON() alone seems
either incomplete or wrong. What I found to work without violating
this documented requirement is the patch below.
Jan
--- a/fs/xfs/xfs_file.c
+++ b/fs/xfs/xfs_file.c
@@ -797,7 +797,7 @@ xfs_file_fallocate(
FALLOC_FL_COLLAPSE_RANGE | FALLOC_FL_ZERO_RANGE))
return -EOPNOTSUPP;
- xfs_ilock(ip, XFS_IOLOCK_EXCL);
+ xfs_rw_ilock(ip, XFS_IOLOCK_EXCL);
if (mode & FALLOC_FL_PUNCH_HOLE) {
error = xfs_free_file_space(ip, offset, len);
if (error)
@@ -877,7 +877,7 @@ xfs_file_fallocate(
}
out_unlock:
- xfs_iunlock(ip, XFS_IOLOCK_EXCL);
+ xfs_rw_iunlock(ip, XFS_IOLOCK_EXCL);
return error;
}
next reply other threads:[~2014-11-03 16:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-03 16:41 Jan Beulich [this message]
2014-11-03 22:18 ` Dave Chinner
2014-11-04 7:40 ` Jan Beulich
2014-11-04 9:08 ` Jan Kara
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5457BE390200007800044838@mail.emea.novell.com \
--to=jbeulich@suse.com \
--cc=david@fromorbit.com \
--cc=jack@suse.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=xfs@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®