FAQ SearchLogin
Tuxera Home
View unanswered posts | View active topics It is currently Thu May 13, 2021 21:42



Post new topic Reply to topic  [ 11 posts ] 
Runs not adjacent at end compressed write index... 
Author Message

Joined: Tue Jul 19, 2011 10:19
Posts: 5
Post Runs not adjacent at end compressed write index...
Hi,

I had Input/Output Errors with an USB HDD, so I used different diagnose tools to check bad sectors... No errors reported.
But I think the culprit is that, which occured just when I noticed the failure, found in my server logs :
Code:
Jul 18 22:01:19 server ntfs-3g[8568]: Runs not adjacent at end compressed write index 0 inode 16126

(I don't think the partition I was writing to was compressed.)

Here is my setup:
  • An external USB HDD (Western Digital Technologies, Inc. Elements 2TB > WD Ext HDD 1021)
  • An arch linux box, (up to date, Linux 2.6.39-ARCH)
  • NTFS-3G 2011.4.12

Could please someone enlight me?
  • What does this error means?
  • Hardware error? ntfs-3G Bug?
  • Any solution/workaround?

For more details, I've looked into ntfs source here is the method synopsis:
Code:
/*
*    Check the validity of a compressed runlist
*  The check starts at the beginning of current run and ends
*  at the end of runlist
*  errno is set if the runlist is not valid
*/

static BOOL valid_compressed_run(ntfs_attr *na, runlist_element *rl,
      BOOL fullcheck, const char *text)


Right now I'm running an extensive low level badblocks check, then I guess I will just reformat to a linux format...
http://www.google.com/search?q=Runs+not+adjacent just gives no relevant results...


Tue Jul 19, 2011 10:45
Profile
NTFS-3G Lead Developer

Joined: Tue Sep 04, 2007 17:22
Posts: 1286
Post Re: Runs not adjacent at end compressed write index...
Hi,

Quote:
Could please someone enlight me?
* What does this error means?
* Hardware error? ntfs-3G Bug?
* Any solution/workaround?

This looks like a software error, the table describing the locations of the file fragments failed a consistency check (undefined fragments or overlapping fragments). Can be either an ntfs-3g bug, or a device which had not been properly unmounted.

Quote:
Right now I'm running an extensive low level badblocks check, then I guess I will just reformat to a linux format...

This does not look like a hardware error, no need to search for bad blocks. What would be useful is to dump the current state of the file for examination :
Code:
ntfsinfo -vi 16126 <unmounted-device>

Then fix the tables by starting "chkdsk /f" on Windows.

If the bug persists after doing a chkdsk, it is an ntfs-3g bug, and I would require your help to locate and fix it. Of course if you reformat, the error will remain untractable and not fixed.

Quote:
http://www.google.com/search?q=Runs+not+adjacent just gives no relevant results...

This is because you are the first one to report such an error.

Regards

Jean-Pierre


Tue Jul 19, 2011 17:04
Profile

Joined: Tue Jul 19, 2011 10:19
Posts: 5
Post Re: Runs not adjacent at end compressed write index...
Thanks for the quick reply Jean-Pierre. I will help you with pleasure to diagnose / fix this issue. (if an ntfs-3G issue ofc)

jpa wrote:
This looks like a software error, the table describing the locations of the file fragments failed a consistency check (undefined fragments or overlapping fragments). Can be either an ntfs-3g bug, or a device which had not been properly unmounted.

I doubt the device has been unproperly unmounted, but maybe it is, I'm using autofs to mount it automatically since it is an USB external drive, but I'm cleanly manually unmounting it before any disconnection.
Could an "USB auto spindown" after an inactivity period cause an unproper unmount? This drive doesnt look like to support p

For information, I'm transferring hundreds of GB over Wifi thought the AFP protocol (Apple nfs/smb like protocol) via netatalk (Linux not-so-stable AFP implementation) could this issue a result of these upper "layers"?
(Which works w/o issues on another drive, internal, ext3...)
I guess I could check this by transferring data just locally... rsync-ing some GB.

jpa wrote:
This does not look like a hardware error, no need to search for bad blocks. What would be useful is to dump the current state of the file for examination :
Code:
ntfsinfo -vi 16126 <unmounted-device>

Then fix the tables by starting "chkdsk /f" on Windows.

If the bug persists after doing a chkdsk, it is an ntfs-3g bug, and I would require your help to locate and fix it. Of course if you reformat, the error will remain untractable and not fixed.

Badblocks destroys the partition, so current data is gone, but I have made several previous tests, even used chkdsk /f before noticing this error log message.
So right now, I'm canceling this paranoid 48h badblocks analysis, reformating the drive, then relaunching a long data transfer, I'm afraid that I will reproduce easily this issue. (2 weeks I'm trying to understand&fix these I/O errors)
I will then post the ntfsinfo as requested.


Tue Jul 19, 2011 17:34
Profile
NTFS-3G Lead Developer

Joined: Tue Sep 04, 2007 17:22
Posts: 1286
Post Re: Runs not adjacent at end compressed write index...
Hi again,

Quote:
Could an "USB auto spindown" after an inactivity period cause an unproper unmount?

This has been a source of errors on MacOSX. It has not been reported so far on Linux, but it could be a source of problems.

Regards

Jean-Pierre


Tue Jul 19, 2011 18:04
Profile
NTFS-3G Lead Developer

Joined: Tue Sep 04, 2007 17:22
Posts: 1286
Post Re: Runs not adjacent at end compressed write index...
Hi,

Attached you will find a temporary patch for capturing the conditions under which the "runlists not adjacent" error appears for the first time. These conditions are written to /var/tmp/ntfs.log, please post them for examination if you get the error.

Regards

Jean-Pierre


Attachments:
compress-capture.patch.gz [742 Bytes]
Downloaded 840 times
Wed Jul 20, 2011 15:35
Profile

Joined: Tue Jul 19, 2011 10:19
Posts: 5
Post Re: Runs not adjacent at end compressed write index...
I will, thanks for the patch.

Still trying to reproduce the issue.
Since yesterday, copied 300GB locally via rsync w/o errors...
Now doing network tests...
So I'm afraid this is related to some kind of spindown / wake up.
Could mount sync options (noasync, sync) change the behavior?

Vincent.


Wed Jul 20, 2011 15:46
Profile
NTFS-3G Lead Developer

Joined: Tue Sep 04, 2007 17:22
Posts: 1286
Post Re: Runs not adjacent at end compressed write index...
Hi,

Quote:
Still trying to reproduce the issue.
Since yesterday, copied 300GB locally via rsync w/o errors...

First of all, make sure the target is marked for compression and you use the "compression" option (this is not the default with ntfs-3g-2011.4.12)
Quote:
So I'm afraid this is related to some kind of spindown / wake up.

Thinking about it, this is unlikely, as ntfs-3g flushes the written data as soon as possible, so the spindown should only occur when the write queue is empty and the device consistent. What I can see as a danger is closing down the system while the device is idle : the wake up delay could cause the unmounting to be only partial, but if you unmount manually, this is unlikely to happen.
Quote:
Could mount sync options (noasync, sync) change the behavior?

Using sync will have a bad impact on the performance, because this disables the caches, which are so useful to store uncompressed data until a full compression block is received and can be compressed.

Regards

Jean-Pierre


Wed Jul 20, 2011 17:11
Profile

Joined: Tue Jul 19, 2011 10:19
Posts: 5
Post Re: Runs not adjacent at end compressed write index...
jpa wrote:
First of all, make sure the target is marked for compression and you use the "compression" option (this is not the default with ntfs-3g-2011.4.12)

Hmm, I'm not sure to follow you, I reformatted the drive, w/o NTFS compression, since I've read somewhere it is not recommended on server side, and not so effective.
I don't remember if the partition was compressed before the reformat when I had this issue. But If I remember well, I can enable compression from windows w/o reformatting, do you want me to do this?
(If my issue is solved just by disabling NTFS compression, great!, but I would anyway help you with pleasure to reproduce/fix using compression)

jpa wrote:
Using sync will have a bad impact on the performance, because this disables the caches, which are so useful to store uncompressed data until a full compression block is received and can be compressed.

I really don't care about performance (at least disk r/w performance) since I'm capped to 5MB/s by Wifi link anyway.
I care more about reliability since it is primarily a remote backup system.


Wed Jul 20, 2011 17:38
Profile
NTFS-3G Lead Developer

Joined: Tue Sep 04, 2007 17:22
Posts: 1286
Post Re: Runs not adjacent at end compressed write index...
Hi,

Quote:
Hmm, I'm not sure to follow you, I reformatted the drive, w/o NTFS compression, since I've read somewhere it is not recommended on server side, and not so effective.
I don't remember if the partition was compressed before the reformat when I had this issue.

Well, the error you reported is very specific to writing (or updating) a compressed file. Sorry for not having put the stress on it before. Maybe you were updating an existing compressed file or creating files in a directory marked for compression, defined as such earlier on Windows (Windows usually does so for files obsoleted by a security fix). A bug or hardware malfunction causing a file to become compressed without being asked to is very unlikely.
Quote:
But If I remember well, I can enable compression from windows w/o reformatting, do you want me to do this?

I guess you must have more urgent things to do, but we are getting into a state where a bug has slipped from our hands without being caught. Maybe you can mark for compression the directory which contained the file which caused problems, then delete its contents and try to recreate the files. No need to reformat or to mark the full partition for compression, just mark a single directory. You may do so on Windows or on Linux, by issuing the command :
Code:
setfattr -v 0x810 -n system.ntfs_attrib_be <dir-name>
# check by :
getfattr -e hex -n system.ntfs_attrib_be <dir-name>

There is nothing urgent, do it when you have time to do so. in the meantime I hope ntfs-3g will provide you with a safe backup.

Regards

Jean-Pierre


Wed Jul 20, 2011 18:36
Profile

Joined: Tue Jul 19, 2011 10:19
Posts: 5
Post Re: Runs not adjacent at end compressed write index...
After a long network transfer, w/o using NTFS compression, I had an error, here are the interesting logs :
Code:
Jul 20 21:01:04 server ntfs-3g[27863]: ntfs_attr_pread error reading '/Some/file' at offset 4104192: 16384 <> 4096: Input/output error
Jul 20 21:01:04 server kernel: [283154.455287] hub 2-1:1.0: cannot disable port 2 (err = -110)
Jul 20 21:01:04 server kernel: [283154.455300] hub 2-1:1.0: cannot reset port 1 (err = -110)
Jul 20 21:01:04 server kernel: [283154.455317] sd 12:0:0:0: Device offlined - not ready after error recovery
Jul 20 21:01:04 server kernel: [283154.455327] sd 12:0:0:0: [sde] Unhandled error code
Jul 20 21:01:04 server kernel: [283154.455328] sd 12:0:0:0: [sde]  Result: hostbyte=0x05 driverbyte=0x00
Jul 20 21:01:04 server kernel: [283154.455330] sd 12:0:0:0: [sde] CDB: cdb[0]=0x2a: 2a 00 1e f3 4f 10 00 00 08 00
Jul 20 21:01:04 server kernel: [283154.455335] end_request: I/O error, dev sde, sector 519261968
Jul 20 21:01:04 server kernel: [283154.455339] Buffer I/O error on device sde2, logical block 64856290
Jul 20 21:01:04 server kernel: [283154.455340] lost page write due to I/O error on sde2
Jul 20 21:01:04 server kernel: [283154.455352] sd 12:0:0:0: rejecting I/O to offline device

Just before I had tons of logs like this :
Code:
Jul 20 21:01:00 server kernel: [283150.661124] RTUSB_VendorRequest failed(-110),TxFlags=0x0, ReqType=IN, Req=0x7, Idx=0x438,pAd->Flags=0x30000002
Jul 20 21:01:01 server kernel: [283151.425940] hub 2-1:1.0: cannot reset port 2 (err = -110)
Jul 20 21:01:01 server kernel: [283151.694232] RTUSB_VendorRequest failed(-110),TxFlags=0x0, ReqType=OUT, Req=0x2, Idx=0x408,pAd->Flags=0x30000002
Jul 20 21:01:01 server kernel: [283151.694248]    Request Value=0x0006!
Jul 20 21:01:02 server kernel: [283152.435722] hub 2-1:1.0: cannot reset port 2 (err = -110)
Jul 20 21:01:02 server kernel: [283152.435725] hub 2-1:1.0: Cannot enable port 2.  Maybe the USB cable is bad?
Jul 20 21:01:02 server kernel: [283152.727375] RTUSB_VendorRequest failed(-110),TxFlags=0x0, ReqType=OUT, Req=0x2, Idx=0x40a,pAd->Flags=0x30000002
Jul 20 21:01:02 server kernel: [283152.727377]    Request Value=0x00f4!
Jul 20 21:01:03 server kernel: [283153.445506] hub 2-1:1.0: cannot disable port 2 (err = -110)
Jul 20 21:01:03 server kernel: [283153.770529] RTUSB_VendorRequest failed(-110),TxFlags=0x0, ReqType=OUT, Req=0x2, Idx=0x408,pAd->Flags=0x30000002
Jul 20 21:01:03 server kernel: [283153.770532]    Request Value=0x000a!:

So my guess is that the drive is unproperly unmounted after a major USB failure...
Because of a bugged USB Wifi Adapter driver, or maybe a USB power issue...
I'll do further testing to understand/fix this.

I think now that it is not a ntfs-3g issue and I won't need to use your debugging patch after all...
Sorry for wasting your time! I didn't noticed any of this in logs previously.

Vincent.


Thu Jul 21, 2011 15:17
Profile
NTFS-3G Lead Developer

Joined: Tue Sep 04, 2007 17:22
Posts: 1286
Post Re: Runs not adjacent at end compressed write index...
Hi,

Quote:
So my guess is that the drive is unproperly unmounted after a major USB failure...
Because of a bugged USB Wifi Adapter driver, or maybe a USB power issue...

Try a USB hub with independent power supply...
Quote:
I think now that it is not a ntfs-3g issue and I won't need to use your debugging patch after all...
Sorry for wasting your time! I didn't noticed any of this in logs previously.

Not a problem, my best wishes for you to locate and fix the defect.

Regards

Jean-Pierre


Thu Jul 21, 2011 17:13
Profile
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Original forum style by Vjacheslav Trushkin.