Re: [PATCH 21/63] xfs: map an inode's offset to an exact physical block

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Sep 30, 2016 at 12:31:07AM -0700, Christoph Hellwig wrote:
> > + * For a remap operation, just "allocate" an extent at the address that the
> > + * caller passed in, and ensure that the AGFL is the right size.  The caller
> > + * will then map the "allocated" extent into the file somewhere.
> > + */
> > +STATIC int
> > +xfs_bmap_remap_alloc(
> > +	struct xfs_bmalloca	*ap)
> > +{
> > +	struct xfs_trans	*tp = ap->tp;
> > +	struct xfs_mount	*mp = tp->t_mountp;
> > +	xfs_agblock_t		bno;
> > +	struct xfs_alloc_arg	args;
> > +	int			error;
> > +
> > +	/*
> > +	 * validate that the block number is legal - the enables us to detect
> > +	 * and handle a silent filesystem corruption rather than crashing.
> > +	 */
> > +	memset(&args, 0, sizeof(struct xfs_alloc_arg));
> > +	args.tp = ap->tp;
> > +	args.mp = ap->tp->t_mountp;
> > +	bno = *ap->firstblock;
> > +	args.agno = XFS_FSB_TO_AGNO(mp, bno);
> > +	ASSERT(args.agno < mp->m_sb.sb_agcount);
> > +	args.agbno = XFS_FSB_TO_AGBNO(mp, bno);
> > +	ASSERT(args.agbno < mp->m_sb.sb_agblocks);
> 
> Shouldn't this return -EFSCORRUPED instead?  Otherwise the comment
> above isn't really true.

Hmm, yes.  I'll fix that up.

--D

> 
> Otherwise this looks fine to me:
> 
> Reviewed-by: Christoph Hellwig <hch@xxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux