From: Rich Johnston <rjohnston@sgi.com>
To: xfs-oss <xfs@oss.sgi.com>
Cc: Eric Sandeen <sandeen@redhat.com>
Subject: [PATCH V2] xfsdump: handle large, wholly-sparse files
Date: Thu, 3 Oct 2013 18:11:42 -0500 [thread overview]
Message-ID: <524DF9AE.7050102@sgi.com> (raw)
In-Reply-To: <524AF8AE.5030300@sgi.com>
In restore_extent_group(), we loop over all extent headers for an inode
in the stream, and add up the cumulatively restored size, accounting
for both HOLE and DATA records and advancing restoredsz as we go.
But for a wholly-sparse file, we have no HOLE header, only
a LAST header, and restoredsz remains at 0.
This makes it look like it's a partially-restored file, split
across streams because the final restoredsz for this stream is
less than the file size, and we go to partial_reg(), which
allocates one slot in persp->a.parrest[] for this inode. But
we've also called partial_reg() with offset/sz of 0/0, which is
less than the file size so this inode never looks "done."
Normally partial_check2() would clear the persp->a.parrest[]
slot in the array when the file is fully restored, but in
this case, that is never satisfied. So all stream slots
get filled as we encounter more inodes like this, and we
eventually get:
"partial_reg: Out of records. Extend attrs applied early."
Fix this by recognizing that if we hit a LAST header with
no restoredsz set (i.e. the LAST header is the only header),
set restoredsz to EOF (bstatp->bs_size) to indicate that
restoration of this file is complete, skip the call to
partial_reg(), and all is well.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Acked-by: Rich Johnston <rjohnston@sgi.com>
---
Test will be submitted later.
Change History
Original patch "[PATCH] xfsrestore: fix multi stream support"
- Patch rename, fixes to code and commit messages by sandeen.
- Additional changes by rjohnston
V2
- Remove changes by rjohnston.
---
restore/content.c | 5 +++++
1 file changed, 5 insertions(+), 0 deletions(-)
Index: b/restore/content.c
===================================================================
--- a/restore/content.c
+++ b/restore/content.c
@@ -7516,6 +7516,11 @@ restore_extent_group( drive_t *drivep,
* we are done.
*/
if ( ehdr.eh_type == EXTENTHDR_TYPE_LAST ) {
+ /* For a wholly sparse file, there is no HOLE
+ * record; advance restoredsz to EOF.
+ */
+ if (!restoredsz)
+ restoredsz = bstatp->bs_size;
break;
}
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2013-10-03 23:11 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-01 16:30 [PATCH] xfsrestore: fix multi stream support Rich Johnston
2013-10-01 20:47 ` Eric Sandeen
2013-10-01 21:39 ` Rich Johnston
2013-10-01 22:02 ` Rich Johnston
2013-10-02 3:57 ` Eric Sandeen
2013-10-02 4:17 ` Eric Sandeen
2013-10-02 4:26 ` Eric Sandeen
2013-10-02 18:41 ` Eric Sandeen
2013-10-02 20:03 ` Rich Johnston
2013-10-02 20:13 ` Eric Sandeen
2013-10-03 13:40 ` Rich Johnston
[not found] ` <20131003212114.493910914@sgi.com>
2013-10-03 22:11 ` [PATCH] xfsdump: handle large, wholly-sparse files Eric Sandeen
2013-10-03 23:11 ` Rich Johnston [this message]
2013-10-03 23:16 ` [PATCH V2] " Eric Sandeen
2013-10-07 19:38 ` [PATCH] xfstests XFS: verify extended attributes after multi-stream xfsdump/xfsrestore rjohnston
2013-10-07 20:32 ` Eric Sandeen
2013-10-07 20:54 ` Rich Johnston
2013-10-07 21:00 ` Eric Sandeen
2013-10-08 0:53 ` Dave Chinner
2013-10-08 0:57 ` Eric Sandeen
2013-10-08 0:58 ` Eric Sandeen
2013-10-08 14:21 ` Rich Johnston
2013-10-08 19:27 ` Dave Chinner
2013-10-08 19:57 ` Eric Sandeen
2013-10-08 1:08 ` Dave Chinner
2013-10-08 14:22 ` Rich Johnston
2013-10-08 14:43 ` [PATCH V2] xfstests XFS: verify extended attributes after multi-stream xfsdump/xfsrestore are not lost rjohnston
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=524DF9AE.7050102@sgi.com \
--to=rjohnston@sgi.com \
--cc=sandeen@redhat.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