summaryrefslogtreecommitdiff
path: root/fs/xfs/xfs_attr_inactive.c
diff options
context:
space:
mode:
authorDave Chinner <david@fromorbit.com>2015-06-23 08:49:01 +1000
committerDave Chinner <david@fromorbit.com>2015-06-23 08:49:01 +1000
commitde50e16ffabf64d30ca9372f39dc855a7553e305 (patch)
tree08b926c00c75fde21823ee8279ce1473546d1356 /fs/xfs/xfs_attr_inactive.c
parent3d238b7e0efc2d9dde7513298ef32da289a6a0f4 (diff)
parentf66bf042693b620133d39af8d2f13615f03eadfc (diff)
Merge branch 'xfs-misc-fixes-for-4.2-3' into for-next
Diffstat (limited to 'fs/xfs/xfs_attr_inactive.c')
-rw-r--r--fs/xfs/xfs_attr_inactive.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/fs/xfs/xfs_attr_inactive.c b/fs/xfs/xfs_attr_inactive.c
index 69a154c58287..2bb959ada45b 100644
--- a/fs/xfs/xfs_attr_inactive.c
+++ b/fs/xfs/xfs_attr_inactive.c
@@ -433,8 +433,14 @@ xfs_attr_inactive(
*/
xfs_trans_ijoin(trans, dp, 0);
- /* invalidate and truncate the attribute fork extents */
- if (dp->i_d.di_aformat != XFS_DINODE_FMT_LOCAL) {
+ /*
+ * Invalidate and truncate the attribute fork extents. Make sure the
+ * fork actually has attributes as otherwise the invalidation has no
+ * blocks to read and returns an error. In this case, just do the fork
+ * removal below.
+ */
+ if (xfs_inode_hasattr(dp) &&
+ dp->i_d.di_aformat != XFS_DINODE_FMT_LOCAL) {
error = xfs_attr3_root_inactive(&trans, dp);
if (error)
goto out_cancel;