All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: "Darrick J. Wong" <djwong@kernel.org>
Cc: Christoph Hellwig <hch@lst.de>, Carlos Maiolino <cem@kernel.org>,
	linux-xfs@vger.kernel.org
Subject: Re: [PATCH 1/2] xfs: track the number of blocks in each buftarg
Date: Tue, 26 Aug 2025 15:28:15 +0200	[thread overview]
Message-ID: <20250826132815.GA1946@lst.de> (raw)
In-Reply-To: <20250825152649.GA812310@frogsfrogsfrogs>

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 :)


  reply	other threads:[~2025-08-26 13:28 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-25 11:19 store the buftarg size in the buftarg v2 Christoph Hellwig
2025-08-25 11:19 ` [PATCH 1/2] xfs: track the number of blocks in each buftarg Christoph Hellwig
2025-08-25 15:26   ` Darrick J. Wong
2025-08-26 13:28     ` Christoph Hellwig [this message]
2025-08-26  5:42   ` Dave Chinner
2025-08-26 13:29     ` Christoph Hellwig
2025-08-25 11:19 ` [PATCH 2/2] xfs: use bt_nr_blocks in xfs_dax_translate_range Christoph Hellwig
  -- strict thread matches above, loose matches on Subject: below --
2025-09-19 13:12 store the buftarg size in the buftarg v4 Christoph Hellwig
2025-09-19 13:12 ` [PATCH 1/2] xfs: track the number of blocks in each buftarg Christoph Hellwig
2025-09-19 17:52   ` Darrick J. Wong
2025-10-13  5:46     ` Darrick J. Wong
2025-10-13  6:29       ` Christoph Hellwig
2025-10-13 14:54         ` Darrick J. Wong
2025-09-16 13:52 store the buftarg size in the buftarg v3 Christoph Hellwig
2025-09-16 13:52 ` [PATCH 1/2] xfs: track the number of blocks in each buftarg Christoph Hellwig
2025-09-17 21:26   ` Dave Chinner
2025-08-18  5:11 store the buftarg size in the buftarg Christoph Hellwig
2025-08-18  5:11 ` [PATCH 1/2] xfs: track the number of blocks in each buftarg Christoph Hellwig
2025-08-18 20:48   ` Darrick J. Wong
2025-08-19  8:06     ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250826132815.GA1946@lst.de \
    --to=hch@lst.de \
    --cc=cem@kernel.org \
    --cc=djwong@kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.