linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: "Darrick J. Wong" <djwong@kernel.org>
Cc: Christoph Hellwig <hch@lst.de>, linux-xfs@vger.kernel.org
Subject: Re: [PATCH] xfs: handle nimaps=0 from xfs_bmapi_write in xfs_alloc_file_space
Date: Tue, 10 Oct 2023 09:59:45 +0200	[thread overview]
Message-ID: <20231010075945.GA9884@lst.de> (raw)
In-Reply-To: <20231009162756.GB21298@frogsfrogsfrogs>

On Mon, Oct 09, 2023 at 09:27:56AM -0700, Darrick J. Wong wrote:
> > +		/*
> > +		 * If xfs_bmapi_write finds a delalloc extent at the requested
> > +		 * range, it tries to convert the entire delalloc extent to a
> > +		 * real allocation.
> > +		 * But if the allocator then can't find an AG with enough space
> > +		 * to at least cover the start block of the requested range,
> 
> Hmm.  Given that you said this was done in the context of delalloc on
> the realtime volume, I don't think there are AGs in play here?  Unless
> the AG actually ran out of space allocating a bmbt block?

Well, really rt group as it was using your rt group patches.  Just
using AG as the more generalized case here.

> My hunch here is that free space on the rt volume is fragmented, but
> there were still enough free rtextents to create a large delalloc
> reservation.  Conversion of the reservation to an unwritten extent
> managed to map one free rtextent into the file, but not enough to
> convert the file mapping all the way to @startoffset_fsb.  Hence the
> bmapi_write call succeeds, but returns @nmaps == 0.

Yes.

> If that's true, I suggest changing the second sentence of the comment to
> read:
> 
> "If the allocator cannot find a single free extent large enough to
> cover the start block of the requested range, xfs_bmapi_write will
> return 0 but leave *nimaps set to 0."

That's probably better indeed.  I'll wait a bit for more comment
and will resend with that update.

      reply	other threads:[~2023-10-10  7:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-09 10:30 handle nimaps=0 from xfs_bmapi_write Christoph Hellwig
2023-10-09 10:30 ` [PATCH] xfs: handle nimaps=0 from xfs_bmapi_write in xfs_alloc_file_space Christoph Hellwig
2023-10-09 16:27   ` Darrick J. Wong
2023-10-10  7:59     ` Christoph Hellwig [this message]

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=20231010075945.GA9884@lst.de \
    --to=hch@lst.de \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).