Skip to content

dedupe.c: fix infinite looping on NoCOW files#376

Merged
JackSlateur merged 1 commit intomarkfasheh:masterfrom
trofi:fix-NoCOW-loop
May 9, 2025
Merged

dedupe.c: fix infinite looping on NoCOW files#376
JackSlateur merged 1 commit intomarkfasheh:masterfrom
trofi:fix-NoCOW-loop

Conversation

@trofi
Copy link
Contributor

@trofi trofi commented Mar 31, 2025

Without the change dedupe hangs on NoCOW files as:

$ dd if=/dev/urandom bs=8M count=1 > a
$ touch b
$ chattr +C b
$ cat a >> b

$ lsattr a b
---------------------- a
---------------C------ b

$ ./duperemove -d -q --batchsize=0 --dedupe-options=partial,same a b
Simple read and compare of file data found 1 instances of files that might benefit from deduplication.
<hung up>

The regression was introduced by c714a4d "dedupe: do not grab block transfer for each file" where fs_blocksize initialization was moved from EINVAL case to somewhere where it never gets executed. THat made INVAL case loop indefinitely.

THe change moves fs_blocksize initialization back to EINVAL handling case.

Closes: #375

Without the change dedupe hangs on NoCOW files as:

    $ dd if=/dev/urandom bs=8M count=1 > a
    $ touch b
    $ chattr +C b
    $ cat a >> b

    $ lsattr a b
    ---------------------- a
    ---------------C------ b

    $ ./duperemove -d -q --batchsize=0 --dedupe-options=partial,same a b
    Simple read and compare of file data found 1 instances of files that might benefit from deduplication.
    <hung up>

The regression was introduced by c714a4d
"dedupe: do not grab block transfer for each file" where `fs_blocksize`
initialization was moved from `EINVAL` case to somewhere where it never
gets executed. THat made `INVAL` case loop indefinitely.

THe change moves `fs_blocksize` initialization back to `EINVAL` handling case.

Closes: markfasheh#375
@JackSlateur JackSlateur merged commit f0efb09 into markfasheh:master May 9, 2025
@JackSlateur
Copy link
Collaborator

Thank you for your contribution

@trofi trofi deleted the fix-NoCOW-loop branch May 9, 2025 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

duperemove is stuck on NoCOW files

2 participants