Commit d87dd636 authored by David Chinner's avatar David Chinner Committed by Lachlan McIlroy

[XFS] Warn if errors come from block_truncate_page().

block_truncate_page() can return errors that we currently ignore and
silently discard. We should not ever get errors reported here - an error
indicates a bug somewhere else. Hence catch the error and issue a stack
dump to the syslog because we cannot propagate the error any further up
the call chain.

SGI-PV: 980084
SGI-Modid: xfs-linux-melb:xfs-kern:30800a
Signed-off-by: default avatarDavid Chinner <dgc@sgi.com>
Signed-off-by: default avatarNiv Sardi <xaiki@sgi.com>
Signed-off-by: default avatarLachlan McIlroy <lachlan@sgi.com>
parent c2b1cba6
...@@ -692,11 +692,19 @@ xfs_vn_setattr( ...@@ -692,11 +692,19 @@ xfs_vn_setattr(
return -error; return -error;
} }
/*
* block_truncate_page can return an error, but we can't propagate it
* at all here. Leave a complaint + stack trace in the syslog because
* this could be bad. If it is bad, we need to propagate the error further.
*/
STATIC void STATIC void
xfs_vn_truncate( xfs_vn_truncate(
struct inode *inode) struct inode *inode)
{ {
block_truncate_page(inode->i_mapping, inode->i_size, xfs_get_blocks); int error;
error = block_truncate_page(inode->i_mapping, inode->i_size,
xfs_get_blocks);
WARN_ON(error);
} }
STATIC int STATIC int
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment