From: Brian Foster <bfoster@redhat.com>
To: Benjamin Wirth <Benjamin.Wirth@winmagic.com>
Cc: "xfs@oss.sgi.com" <xfs@oss.sgi.com>
Subject: Re: on-disk free blocks B-Tree update
Date: Sat, 18 Jun 2016 09:27:42 -0400 [thread overview]
Message-ID: <20160618132742.GB47303@bfoster.bfoster> (raw)
In-Reply-To: <97A4F433DEE099488FE21C1718A641D213A0320A@wmsexchsvr02.winmagic.local>
On Fri, Jun 17, 2016 at 08:02:59PM +0000, Benjamin Wirth wrote:
> Hello XFS community,
>
> I have code that parses the free blocks B-Tree from the disk but it seems to me that the on-disk version of the B-Tree is not updated even when sync() is called, so that the disk version of the B-Tree becomes outdated. Is that correct?
>
> I have debug information from the kernel BIO layer where I see sectors/blocks being flushed out by the sync but the B-Tree on disk still lists those blocks as free. At what time is the on-disk B-Tree updated, only at umount?
>
Calling sync() will first flush out all cached user data. This, in turn,
may result in block allocation transactions, etc. sync() then calls into
the fs superblock ->sync_fs() handler, which on XFS forces the log to
disk. This means the metadata changes associated with the user data are
persistent in the log, but not necessarily written back to disk. This
occurs some time later according to the internal state of the fs.
> Is there any way to force the in-memory B-Tree to be flushed to disk?
>
The only thing that comes to mind is to freeze ('fsfreeze -f <mnt>') the
fs, which appears to push the AIL. This is really the only way to get a
coherent view of the fs on disk while mounted, anyways. I also assume
you're using direct I/O, as the underlying disk buffer/page cache is not
coherent with XFS I/O.
Brian
> Thanks for any help,
> Ben
>
> Benjamin Wirth | Senior Software Developer
> WinMagic Inc.
> 5600A Cancross Court
> Mississauga, ON | L5R 3E9 | Canada
>
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
prev parent reply other threads:[~2016-06-18 13:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-17 20:02 on-disk free blocks B-Tree update Benjamin Wirth
2016-06-18 13:27 ` Brian Foster [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=20160618132742.GB47303@bfoster.bfoster \
--to=bfoster@redhat.com \
--cc=Benjamin.Wirth@winmagic.com \
--cc=xfs@oss.sgi.com \
/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