On Fri, Jan 10, 2020 at 03:55:40AM -0800, Christoph Hellwig wrote: > > + struct xfs_mount *mp = ip->i_mount; > > + struct xfs_buf *bp; > > + xfs_daddr_t dblkno; > > + int dblkcnt; > > + > > + ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL)); > > + > > + dblkno = XFS_FSB_TO_DADDR(mp, map->br_startblock), > > + dblkcnt = XFS_FSB_TO_BB(mp, map->br_blockcount); > > + > > + /* > > + * If the "remote" value is in the cache, remove it. > > + */ > > + bp = xfs_buf_incore(mp->m_ddev_targp, dblkno, dblkcnt, XBF_TRYLOCK); > > Do we really need the dblkno and dblkcnt local variables here? Eh, not really. > > @@ -592,18 +614,8 @@ xfs_attr_rmtval_remove( > > ASSERT((map.br_startblock != DELAYSTARTBLOCK) && > > (map.br_startblock != HOLESTARTBLOCK)); > > > > - dblkno = XFS_FSB_TO_DADDR(mp, map.br_startblock), > > - dblkcnt = XFS_FSB_TO_BB(mp, map.br_blockcount); > > - > > - /* > > - * If the "remote" value is in the cache, remove it. > > - */ > > - bp = xfs_buf_incore(mp->m_ddev_targp, dblkno, dblkcnt, XBF_TRYLOCK); > > - if (bp) { > > - xfs_buf_stale(bp); > > - xfs_buf_relse(bp); > > - bp = NULL; > > - } > > + if (map.br_startblock != HOLESTARTBLOCK) > > + xfs_attr_rmtval_stale(args->dp, &map); > > I don't think we need the HOLESTARTBLOCK check here, given that we have > the asserts above. I also think the assert should move into > xfs_attr_rmtval_stale and be split into two asserts, one each for the > invalid values. <nod> I'll upgrade them to proper fs corruption messages while I'm at it. --D