lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f875e2fe1003051427u70aa1a4cl56c51c73cab4f1b0@mail.gmail.com>
Date:	Fri, 5 Mar 2010 17:27:50 -0500
From:	s ponnusa <foosaa@...il.com>
To:	Alan Cox <alan@...rguk.ukuu.org.uk>
Cc:	Robert Hancock <hancockrwd@...il.com>,
	Mark Lord <kernel@...savvy.com>,
	Greg Freemyer <greg.freemyer@...il.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	linux-kernel@...r.kernel.org, linux-ide@...r.kernel.org,
	Jens Axboe <jens.axboe@...cle.com>, linux-mm@...ck.org
Subject: Re: Linux kernel - Libata bad block error handling to user mode 
	program

Having fsync / fdatasync results in the below mentioned behavior.

> - sectors being corrupted/dying that were not written by near to it
> - writes that the drive thinks were successful and reports that way but
>  turn out not to be readable

Always the write passes after much delay, but it turns out that the
sector is not readable.
But for my scenario, I need to know when a sector timeouts / errors
during the write process and move on to the next sector. Apparently I
have changed my program to do the following steps:

Open the drive in O_RDWR mode.
write a sector.
reposition the file pointer.
read the sector.
verify the read buffer contents with write buffer contents.

This scenario always passes and does not identify the bad sectors if
the program does it sequentially (even on a hdd with bad sectors).

But if I write using an independent program (prg A) and verify using
another independent program (prg B), all the writes done using prg A
passes (expected behavior) and the read operations from prg B fails on
bad sectors (again expected behavior) and I am able to detect the bad
sectors.

Is there any issue, if I perform both the operations simultaneously?
(Initially I tried using the O_DIRECT mode and as it was extremely
slow reverted to opening the device in O_RDWR mode and used fadvise
with don'tneed flag).

Thanks.

On Fri, Mar 5, 2010 at 7:03 AM, Alan Cox <alan@...rguk.ukuu.org.uk> wrote:
>> cannot be read back by any other means. And the program which wrote
>> the data is unaware of the error that has happened at the lower level.
>> But the error log clearly has the issue caught but is trying to handle
>> differently.
>
> This is standard behaviour on pretty much every OS. If each write was
> back verified by the OS you wouldn't get any work done due fact it took
> so long to do any I/O and all I/O was synchronoous.
>
> Where it matters you can mount some file systems synchronous, you can do
> synchronous I/O (O_SYNC) or you can use and check fsync/fdatasync results
> which should give you pretty good coverage providing barriers are enabled.
>
> It still won't catch a lot of cases because you sometimes see
>
> - sectors being corrupted/dying that were not written by near to it
> - writes that the drive thinks were successful and reports that way but
>  turn out not to be readable
>
> Alan
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ