aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/xfs/xfs_icache.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c
index b239da91c43b..32908909815e 100644
--- a/fs/xfs/xfs_icache.c
+++ b/fs/xfs/xfs_icache.c
@@ -1175,14 +1175,19 @@ xfs_inode_match_id(
1175 struct xfs_inode *ip, 1175 struct xfs_inode *ip,
1176 struct xfs_eofblocks *eofb) 1176 struct xfs_eofblocks *eofb)
1177{ 1177{
1178 if (eofb->eof_flags & XFS_EOF_FLAGS_UID) 1178 if (eofb->eof_flags & XFS_EOF_FLAGS_UID &&
1179 return ip->i_d.di_uid == eofb->eof_uid; 1179 ip->i_d.di_uid != eofb->eof_uid)
1180 else if (eofb->eof_flags & XFS_EOF_FLAGS_GID) 1180 return 0;
1181 return ip->i_d.di_gid == eofb->eof_gid;
1182 else if (eofb->eof_flags & XFS_EOF_FLAGS_PRID)
1183 return xfs_get_projid(ip) == eofb->eof_prid;
1184 1181
1185 return 0; 1182 if (eofb->eof_flags & XFS_EOF_FLAGS_GID &&
1183 ip->i_d.di_gid != eofb->eof_gid)
1184 return 0;
1185
1186 if (eofb->eof_flags & XFS_EOF_FLAGS_PRID &&
1187 xfs_get_projid(ip) != eofb->eof_prid)
1188 return 0;
1189
1190 return 1;
1186} 1191}
1187 1192
1188STATIC int 1193STATIC int
@@ -1210,10 +1215,7 @@ xfs_inode_free_eofblocks(
1210 mapping_tagged(VFS_I(ip)->i_mapping, PAGECACHE_TAG_DIRTY)) 1215 mapping_tagged(VFS_I(ip)->i_mapping, PAGECACHE_TAG_DIRTY))
1211 return 0; 1216 return 0;
1212 1217
1213 if (eofb && 1218 if (eofb && !xfs_inode_match_id(ip, eofb))
1214 (eofb->eof_flags & (XFS_EOF_FLAGS_UID|XFS_EOF_FLAGS_GID|
1215 XFS_EOF_FLAGS_PRID)) &&
1216 !xfs_inode_match_id(ip, eofb))
1217 return 0; 1219 return 0;
1218 1220
1219 ret = xfs_free_eofblocks(ip->i_mount, ip, true); 1221 ret = xfs_free_eofblocks(ip->i_mount, ip, true);