···310 * Fix up the start offset of the attribute fork311 */312 totsize -= size;313- if (totsize == sizeof(xfs_attr_sf_hdr_t) && !args->addname) {0314 /*315 * Last attribute now removed, revert to original316 * inode format making all literal area available···329 xfs_idata_realloc(dp, -size, XFS_ATTR_FORK);330 dp->i_d.di_forkoff = xfs_attr_shortform_bytesfit(dp, totsize);331 ASSERT(dp->i_d.di_forkoff);332- ASSERT(totsize > sizeof(xfs_attr_sf_hdr_t) || args->addname);0333 dp->i_afp->if_ext_max =334 XFS_IFORK_ASIZE(dp) / (uint)sizeof(xfs_bmbt_rec_t);335 dp->i_df.if_ext_max =···739 + name_loc->namelen740 + INT_GET(name_loc->valuelen, ARCH_CONVERT);741 }742- if (bytes == sizeof(struct xfs_attr_sf_hdr))0743 return(-1);744 return(xfs_attr_shortform_bytesfit(dp, bytes));745}···778 goto out;779780 if (forkoff == -1) {00781 /*782 * Last attribute was removed, revert to original783 * inode format making all literal area available
···310 * Fix up the start offset of the attribute fork311 */312 totsize -= size;313+ if (totsize == sizeof(xfs_attr_sf_hdr_t) && !args->addname &&314+ !(mp->m_flags & XFS_MOUNT_COMPAT_ATTR)) {315 /*316 * Last attribute now removed, revert to original317 * inode format making all literal area available···328 xfs_idata_realloc(dp, -size, XFS_ATTR_FORK);329 dp->i_d.di_forkoff = xfs_attr_shortform_bytesfit(dp, totsize);330 ASSERT(dp->i_d.di_forkoff);331+ ASSERT(totsize > sizeof(xfs_attr_sf_hdr_t) || args->addname ||332+ (mp->m_flags & XFS_MOUNT_COMPAT_ATTR));333 dp->i_afp->if_ext_max =334 XFS_IFORK_ASIZE(dp) / (uint)sizeof(xfs_bmbt_rec_t);335 dp->i_df.if_ext_max =···737 + name_loc->namelen738 + INT_GET(name_loc->valuelen, ARCH_CONVERT);739 }740+ if (!(dp->i_mount->m_flags & XFS_MOUNT_COMPAT_ATTR) &&741+ (bytes == sizeof(struct xfs_attr_sf_hdr)))742 return(-1);743 return(xfs_attr_shortform_bytesfit(dp, bytes));744}···775 goto out;776777 if (forkoff == -1) {778+ ASSERT(!(dp->i_mount->m_flags & XFS_MOUNT_COMPAT_ATTR));779+780 /*781 * Last attribute was removed, revert to original782 * inode format making all literal area available