Re: [PATCH 3/6] xfs: xfs_quota_unreserve_blkres can't fail

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

 



On Sat, Mar 30, 2024 at 06:57:55AM +0100, Christoph Hellwig wrote:
> On Fri, Mar 29, 2024 at 09:21:23AM -0700, Darrick J. Wong wrote:
> > > +static inline void
> > >  xfs_quota_unreserve_blkres(struct xfs_inode *ip, int64_t blocks)
> > >  {
> > > -	return xfs_quota_reserve_blkres(ip, -blocks);
> > > +	/* don't return an error as unreserving quotas can't fail */
> > > +	xfs_quota_reserve_blkres(ip, -blocks);
> > 
> > xfs_quota_reserve_blkres only doesn't fail if the nblks argument is
> > actually negative.  Can we have an ASSERT(blocks >= 0) here to guard
> > against someone accidentally passing in a negative @blocks here?
> 
> Sure.  Or even better just mark blocks as unsigned?

<shrug> I guess that works.

--D




[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