https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292198
Bug ID: 292198
Summary: /usr/bin/diff silently ignores hardware errors
Product: Base System
Version: Unspecified
Hardware: Any
OS: Any
Status: New
Severity: Affects Only Me
Priority: ---
Component: bin
Assignee: [email protected]
Reporter: [email protected]
Created attachment 266843
--> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=266843&action=edit
Git patch (works against current and 14.3)
I just burned a couple of Blu Ray data disks.
Since I don't trust optical media that much, I thought I should check.
So...
> mount /mnt/bluray
> diff -rq /mnt/bluray originaldata/
No output, so everything good, isn't it?
Hadn't I by chance seen some ahci MEDIUM ERROR (uncorrectable error) in the
logs I would have stored these disks away and could only hope I wouldn't ever
need them!
Let's check again...
> diff -rqs /mnt/bluray originaldata/
No output???
> mkdir newdata/
> cp -R /mnt/bluray/* newdata/
> cp: /mnt/bluray/file1: Input/output error
> cp: /mnt/bluray/file2: Input/output error
> cp: /mnt/bluray/file4: Input/output error
> ...
So I had to conclude that diff silently ignores files when an underlying
hardware error happens and cannot be trusted!!!
For comparison:
> gdiff -rq /mnt/bluray originaldata/
gdiff: /mnt/bluray/file1: Input/output error
Now I wonder how many of my optical disk were not readable when I put them
away.
IMO this is so bad it should deserve an EN.
The patch I'm attaching is not perfect (at this point in the code, we don't
know which of the two files failed), but at least gives an hint something is
wrong. Perhaps someone can come up with a better solution, but if that takes
times, I think this is better than a silent failure.
--
You are receiving this mail because:
You are the assignee for the bug.