Re: [PATCH 1/2] xfs: track the number of blocks in each buftarg

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

 



On Mon, Aug 25, 2025 at 08:26:49AM -0700, Darrick J. Wong wrote:
> > +	mp->m_ddev_targp->bt_nr_blocks = mp->m_sb.sb_dblocks;
> > +	if (mp->m_rtdev_targp && mp->m_rtdev_targp != mp->m_ddev_targp)
> > +		mp->m_rtdev_targp->bt_nr_blocks = mp->m_sb.sb_dblocks;
> 
> Crazy question here: say we start with dblocks==1G on a 2GB disk.  Then
> we start growfs to double the size of the filesystem, but crash midway
> through.  Then in the process of restarting the system, some harried
> sysadmin accidentally shrinks the disk to 1GB before letting the
> filesystem mount.  Log recovery will try to replay the expansion, but
> now the disk is no longer large enough to contain the filesystem.
> 
> Should we be checking for that here and erroring out?

I don't think having tons of sanity checks here hurts, but I also
don't volunteer to implement it as there's a lot of bigger fish to
fry :)





[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