summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_attr_inactive.c
diff options
context:
space:
mode:
authorDave Chinner <david@fromorbit.com>2015-06-23 00:49:01 +0200
committerDave Chinner <david@fromorbit.com>2015-06-23 00:49:01 +0200
commitde50e16ffabf64d30ca9372f39dc855a7553e305 (patch)
tree08b926c00c75fde21823ee8279ce1473546d1356 /fs/xfs/xfs_attr_inactive.c
parentMerge branch 'xfs-freelist-cleanup' into for-next (diff)
parentxfs: don't truncate attribute extents if no extents exist (diff)
downloadlinux-de50e16ffabf64d30ca9372f39dc855a7553e305.tar.xz
linux-de50e16ffabf64d30ca9372f39dc855a7553e305.zip
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;