tjohansen14 / diskscrub

Automatically exported from code.google.com/p/diskscrub
GNU General Public License v2.0
0 stars 0 forks source link

scrub aborts with No such processes error #19

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Date: Mon, 18 Jun 2012 20:21:48 -0700
From: "H. Peter Anvin" <hpa@zytor.com>
To: Jim Garlick <garlick.jim@gmail.com>, richard.b.hill@intel.com
Subject: Re: Amusing message...
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120430
        Thunderbird/12.0.1

[snip]
I get the following error with top-of-tree
trying to run scrub on a machine (Core i7-2600K) without RDRAND, unless
I specify -t:

[root@tazenda diskscrub]# ./src/scrub -p nnsa /dev/sdg
scrub: using NNSA NAP-14.1-C patterns
scrub: please verify that device size below is correct!
scrub: scrubbing /dev/sdg 2000398934016 bytes (~1TB)
scrub: random  |.scrub: /dev/sdg: No such process               |

With -t it works normally.

        -hpa

--
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.

Original issue reported on code.google.com by garlick....@gmail.com on 19 Jun 2012 at 3:50

GoogleCodeExporter commented 8 years ago
$ dd if=/dev/zero bs=1k seek=$((1024*1024*2 + 1)) count=1 of=/tmp/yyyy
1+0 records in
1+0 records out
1024 bytes (1.0 kB) copied, 7.9554e-05 s, 12.9 MB/s
$ /usr/bin/scrub -p nnsa /tmp/yyyy
scrub: using NNSA NAP-14.1-C patterns
scrub: padding /tmp/yyyy with 2048 bytes to fill last fs block
scrub: scrubbing /tmp/yyyy 2147487744 bytes (~2GB)
scrub: random  |.....^C                                         |
mrhankey /home/garlick/proj/diskscrub/diskscrub > dd if=/dev/zero bs=1k 
seek=$((1024*1024*3)) count=1 of=/tmp/yyyy
1+0 records in
1+0 records out
1024 bytes (1.0 kB) copied, 9.1152e-05 s, 11.2 MB/s
$ /usr/bin/scrub -p nnsa /tmp/yyyy
scrub: using NNSA NAP-14.1-C patterns
scrub: padding /tmp/yyyy with 3072 bytes to fill last fs block
scrub: scrubbing /tmp/yyyy 3221229568 bytes (~3GB)
scrub: random  |.scrub: /tmp/yyyy: No such process   

Here's the fix

$ git show 95e14224da038ce7e0e979c296149404943af600
commit 95e14224da038ce7e0e979c296149404943af600
Author: Jim Garlick <garlick.jim@gmail.com>
Date:   Wed Jun 20 14:39:18 2012 -0700

    Fix scrub aborts with No such process (issue 19)

    Used an int instead of an off_t to hold file size.
    This was introduced with fillfile threading in scrub-2.5.0.
    Failure is immediate and obvious for targets > 2G.

diff --git a/src/fillfile.c b/src/fillfile.c
index 9055746..e0f67b6 100644
--- a/src/fillfile.c
+++ b/src/fillfile.c
@@ -74,7 +74,7 @@ refill_thread(void *arg)

 static int
 refill_memcpy(struct memstruct *mp, unsigned char *mem, int memsize,
-              int filesize, int written)
+              off_t filesize, off_t written)
 {
 #if WITH_PTHREADS
     if (no_threads) {

Original comment by garlick....@gmail.com on 20 Jun 2012 at 9:47

GoogleCodeExporter commented 8 years ago
I am also getting the same error using version 2.5.3. can you let me know if it 
has been already implement in 2.5.22 version or yet to be implemented. How do 
it fix it manually ? do i need to use "int" in place of "off_t" ? and recompile 
with make again

Appreciate any help provided. The tool seems to be awesome and really would 
like to use it.

Thanks
Banku

Original comment by bankur...@gmail.com on 17 Sep 2012 at 8:34

GoogleCodeExporter commented 8 years ago
Hi Banku - that change went in 2.5.2.  There is no 2.5.3.
If you are building from source could you check your src/fillfile.c line 77
to see if the above patch has been applied?  If not then please verify
your version - what does the META file in top level directory say?

Original comment by garlick....@gmail.com on 17 Sep 2012 at 10:47