Skip to contentSkip to conversation

xfs Digest, Vol 29, Issue 102

DISCUSSION lord worm 2 participants 2 messages Jan 31, 2011 1 message not in the archive

lore
Share & tools
lore

lord worm

author
#1 lore raw
In reply to a message not in the archive

Stan, do you check dates on links before you paste them here? I don't care if its the 1st results of the google search 'meaning of life', its irrelevant and oudated.

Quoted 311 lines

From: [email protected]
Subject: xfs Digest, Vol 29, Issue 102
To: [email protected]
Date: Sun, 30 Jan 2011 21:49:14 -0600

Send xfs mailing list submissions to
[email protected]

To subscribe or unsubscribe via the World Wide Web, visit
http://oss.sgi.com/mailman/listinfo/xfs
or, via email, send a message with subject or body 'help' to
[email protected]

You can reach the person managing the list at
[email protected]

When replying, please edit your Subject line so it is more specific than "Re: Contents of xfs digest..."

Today's Topics:

1. RE: xfs Digest, Vol 29, Issue 101 (lord worm)
2. Re: xfs Digest, Vol 29, Issue 101 (Stan Hoeppner)
3. Re: [patch] xfsprogs: repair pagefault due to missed out
sanity NULL check (Ajeet Yadav)
4. Re: [patch] xfsprogs: repair never return if device removed (Ajeet Yadav)
5. Re: how to decode metadump info produced by xfs_db, and
superblock error (Dave Chinner)

----------------------------------------------------------------------

Message: 1
Date: Sun, 30 Jan 2011 13:27:51 -0500
From: lord worm <[email protected]>
Subject: RE: xfs Digest, Vol 29, Issue 101
To: <[email protected]>
Message-ID: <[email protected]>
Content-Type: text/plain; charset="iso-8859-1"

Stan I have no idea, could you tell me in detail why dd failed, and what exactly those restore commands provide specifically?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://oss.sgi.com/pipermail/xfs/attachments/20110130/dee98fcc/attachment-0001.htm>

------------------------------

Message: 2
Date: Sun, 30 Jan 2011 15:03:42 -0600
From: Stan Hoeppner <[email protected]>
Subject: Re: xfs Digest, Vol 29, Issue 101
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1

lord worm put forth on 1/30/2011 12:27 PM:

Quoted 2 lines

Stan I have no idea, could you tell me in detail why dd failed, and what exactly those restore commands provide specifically?

This might have some relevance. 2nd hit Googling for "dd with xfs":

http://oss.sgi.com/archives/xfs/2003-04/msg00802.html

Signature · 23 lines
Stan



------------------------------

Message: 3
Date: Mon, 31 Jan 2011 11:39:15 +0900
From: Ajeet Yadav <[email protected]>
Subject: Re: [patch] xfsprogs: repair pagefault due to missed out
	sanity NULL	check
To: [email protected]
Message-ID:
	<[email protected]>
Content-Type: text/plain; charset="iso-8859-1"

I did not receive any response / review comment on solution patch I sent.

diff -Nurp xfsprogs/repair/dir2.c xfsprogs-dirty/repair/dir2.c

--- xfsprogs/repair/dir2.c 2010-07-16 13:07:09.000000000 +0900

+++ xfsprogs-dirty/repair/dir2.c 2011-01-28 18:49:21.000000000 +0900
(quoted diff) +2 -1
@@ -110,9 +110,10 @@ da_read_buf(
 
 bplist[i] = libxfs_readbuf(mp->m_dev,
 
 XFS_FSB_TO_DADDR(mp, bmp[i].startblock),
 
 XFS_FSB_TO_BB(mp, bmp[i].blockcount), 0);
 
- if (!bplist[i])
 
+ if (!bplist[i]){
 
+ nex = i;

goto failed;

-

+ }

pftrace("readbuf %p (%llu, %d)", bplist[i],

(long long)XFS_BUF_ADDR(bplist[i]),

XFS_BUF_COUNT(bplist[i]));

Quoted 39 lines · Ajeet Yadav

libxfs_putbuf() is called with bp = NULL, resulting in pagefault in libpthread.

Function da_read_buf() allocate array of xfs_buf_t *

* xfs_buf_t **bplist;*

* bplist = calloc(nex, sizeof(*bplist));*

Read and fill it using

*for (i = 0; i < nex; i++) {
bplist[i] = libxfs_readbuf()*

*    if (!bplist[i]){
        goto failed;
    }  *

*}*

*failed:

        for (i = 0; i < nex; i++)
                libxfs_putbuf(bplist[i]);*

Now assume nex = 10,

1. Will create bplist for 10 array elements.

3. Reading from disk 0,1, 2, 3

4. When reading from disk 4, USB is removed

5. libxfs_readbuf() will at fail, pblist[4] = NULL, goto failed.

6. Since only 4 buffers were read successfully, so only 4 are in lock state.

7. Error handling will unlock buffer from 1-10

Quoted 11 lines

8. Buffer 0-3 were read successfully, hence will have valid pdlist[i]

9. Access pblist[4] == NULL, therefore unlocking will set bp == NULL in libxfs_putbuf(bp);
10. Page fault in libpthread

Solution patch attached with mail

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://oss.sgi.com/pipermail/xfs/attachments/20110131/4e2718ae/attachment-0001.htm>

------------------------------

Message: 4
Date: Mon, 31 Jan 2011 11:41:16 +0900
From: Ajeet Yadav <[email protected]>
Subject: Re: [patch] xfsprogs: repair never return if device removed
To: [email protected]
Message-ID:
<[email protected]>
Content-Type: text/plain; charset="iso-8859-1"

I did not receive and response / reviews on patch.

diff -Nurp xfsprogs/repair/sb.c xfsprogs-dirty/repair/sb.c

--- xfsprogs/repair/sb.c 2011-01-28 20:23:02.000000000 +0900

+++ xfsprogs-dirty/repair/sb.c 2011-01-28 20:21:06.000000000 +0900

(quoted diff) +1 -1
@@ -122,8 +122,9 @@ find_secondary_sb(xfs_sb_t *rsb)
 
 done = 1;
 
 }
 
- if (!done && (bsize = read(x.dfd, sb, BSIZE)) == 0) {
 
+ if (!done && (bsize = read(x.dfd, sb, BSIZE)) <= 0) {
 

done = 1;

+ do_warn(_("Couldn't find candidate secondary superblock, exiting...\n"));

}

do_warn(".");

Quoted 11 lines · Ajeet Yadav

xfsprogs all version, delete primary superblock of xfs partition

dd if=/dev/zero of=/dev/sda1 bs=512 count=1
sync

Run xfs_repair in partition, while its searching for secondary superblock, remove the disk (USB) xfs_repair will never exit and will loop in never ending ............

Please find patch attached with mail

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://oss.sgi.com/pipermail/xfs/attachments/20110131/77ad227f/attachment-0001.htm>

------------------------------

Message: 5
Date: Mon, 31 Jan 2011 14:51:31 +1100
From: Dave Chinner <[email protected]>
Subject: Re: how to decode metadump info produced by xfs_db, and
superblock error
To: lord worm <[email protected]>
Cc: [email protected]
Message-ID: <20110131035131.GI21311@dastard>
Content-Type: text/plain; charset=us-ascii

Quoted 26 lines · lord worm
Quoted 26 lines

Date: Mon, 31 Jan 2011 08:40:26 +1100
From: [email protected]
To: [email protected]
Subject: Re: how to decode metadump info produced by xfs_db, and superblock error

Quoted 19 lines · lord worm
Quoted 8 lines

Date: Sun, 30 Jan 2011 18:16:30 +1100
From: [email protected]
To: [email protected]
CC: [email protected]
Subject: Re: how to decode metadump info produced by xfs_db, and superblock error

Quoted 1 line · lord worm
Quoted 8 lines
Quoted 6 lines

What kind of information is in this file produced by metadump, is it worth reading it somehow?

I'm trying to first understand what's causing a 'superblock cannot be read' error in my XFS after a succesfully dd of the partition (dd succeeds in copying to a file, and also restoring, but after restoring it cannot mount).

dmesg output when the mount fails?

Could you email the mailing list next time as well, so that my forwards are directed towards everyone, please?

Quoted 6 lines
Quoted 6 lines

I did:

http://oss.sgi.com/archives/xfs/2011-01/msg00486.html

As for list ettiquette - please don't top post and wrap all you text except for code and pasted log messages at 72 columns.....

Fixed that for you again.

Quoted 7 lines
Quoted 7 lines
Quoted 6 lines

Here's dmesg from the backup file, but I don't have it from the original disk after restoring it:

[  362.685464] attempt to access beyond end of device
[  362.685468] loop5: rw=0, want=15662872, limit=15661056
[  362.685473] I/O error in filesystem ("loop5") meta-data dev loop5 block 0xeeff17       ("xfs_read_buf") error 5 buf count 512
[  362.685478] XFS: size check 2 failed
Quoted 5 lines
Quoted 2 lines

Simple problem - you copied the filesystem back onto a device that is too small for the filesystem.

When I reply to this email, it defaults to [email protected], so how will the others see it?

Reply to all. It's common courtesy to reply to everyone on the cc-list for mailing list traffic as it often contains people not subscribed to the mailing list (e.g. a person reporting a bug).

I've added the xfs list back onto the cc-list.

Quoted 2 lines

I can't mount the direct dd image of the drive as a loop device either by the same error.

Which means you probably didn't copy the entire drive in the first place.

Quoted 4 lines

The error persists even when its not
the filesystem that was copied back onto the device. Additionally, its the exact same device with the exact same partition type created by the exact same version of disk.

partition type doesn't matter - the size does. The above error indicates that the loop device is 1816 sectors (908kiB) shorter than it needs to be, so maybe you aren't recreating the partition as large as it needs to be, too....

Quoted 23 lines

As it is, the question I have at this point is why are you trying to copy the filesystem via dd? if all you want is an image, xfs_copy is probably what you want....

Cheers,

Dave.

Signature · 15 lines
Dave Chinner
[email protected]



------------------------------

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs


End of xfs Digest, Vol 29, Issue 102
************************************

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#2 lore raw

lord worm put forth on 1/30/2011 10:41 PM:

Quoted 1 line

Stan, do you check dates on links before you paste them here? I don't care if its the 1st results of the google search 'meaning of life', its irrelevant and oudated.

At the time I sent that reply, you had posted no log information, nothing concrete to allow us to focus our troubleshooting efforts. At that time, the information in the link I provided could have been as relevant as any other. At that time I had not seen the off list back-n-forth between you and Dave that contained a little bit more information from you. Note that I said "might be relevant", not "this is your answer".

Note that Dave recently pointed an OP to a 1996 XFS paper. Some information in that 15 year old paper is still relevant today. You cannot simply discard information because it appears "old" to you. Some aspects of XFS haven't changed in 16 years.

As I said in my first response, xfsdump/xfsrestore would have avoided your current problem, as well as xfs_copy, as Dave pointed out.

There is nothing set in stone that prevents dd from working with XFS filesystems. However, it is obviously less forgiving of error, user or otherwise, than the 'equivalent' XFS utilities.

Lastly, getting testy with those attempting to assist you isn't going to further your efforts in fixing your problem.

Signature · 6 lines
Stan

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs