diff options
Diffstat (limited to 'fs/xfs/xfs_attr_list.c')
-rw-r--r-- | fs/xfs/xfs_attr_list.c | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/fs/xfs/xfs_attr_list.c b/fs/xfs/xfs_attr_list.c index 64f6ceba9254..01cbc1950cfd 100644 --- a/fs/xfs/xfs_attr_list.c +++ b/fs/xfs/xfs_attr_list.c @@ -86,11 +86,9 @@ xfs_attr_shortform_list( (XFS_ISRESET_CURSOR(cursor) && (dp->i_afp->if_bytes + sf->hdr.count * 16) < context->bufsize)) { for (i = 0, sfe = &sf->list[0]; i < sf->hdr.count; i++) { - if (!xfs_attr_namecheck(sfe->nameval, sfe->namelen)) { - XFS_ERROR_REPORT(__func__, XFS_ERRLEVEL_LOW, - context->dp->i_mount); + if (XFS_CORRUPT_ON(context->dp->i_mount, + !xfs_attr_namecheck(sfe->nameval, sfe->namelen))) return -EFSCORRUPTED; - } context->put_listent(context, sfe->flags, sfe->nameval, @@ -179,9 +177,8 @@ xfs_attr_shortform_list( cursor->hashval = sbp->hash; cursor->offset = 0; } - if (!xfs_attr_namecheck(sbp->name, sbp->namelen)) { - XFS_ERROR_REPORT(__func__, XFS_ERRLEVEL_LOW, - context->dp->i_mount); + if (XFS_CORRUPT_ON(context->dp->i_mount, + !xfs_attr_namecheck(sbp->name, sbp->namelen))) { error = -EFSCORRUPTED; goto out; } @@ -269,8 +266,7 @@ xfs_attr_node_list_lookup( return 0; /* We can't point back to the root. */ - if (cursor->blkno == 0) { - XFS_ERROR_REPORT(__func__, XFS_ERRLEVEL_LOW, mp); + if (XFS_CORRUPT_ON(mp, cursor->blkno == 0)) { return -EFSCORRUPTED; } } @@ -473,11 +469,9 @@ xfs_attr3_leaf_list_int( valuelen = be32_to_cpu(name_rmt->valuelen); } - if (!xfs_attr_namecheck(name, namelen)) { - XFS_ERROR_REPORT(__func__, XFS_ERRLEVEL_LOW, - context->dp->i_mount); + if (XFS_CORRUPT_ON(context->dp->i_mount, + !xfs_attr_namecheck(name, namelen))) return -EFSCORRUPTED; - } context->put_listent(context, entry->flags, name, namelen, valuelen); if (context->seen_enough) |