changed debian/source/format to native

This commit is contained in:
openKylinBot 2022-05-14 00:34:45 +08:00
parent 3e8fe064e9
commit 92ba116d30
4 changed files with 1 additions and 121 deletions

View File

@ -1,26 +0,0 @@
From: Utopia Maintenance Team
<pkg-utopia-maintainers@lists.alioth.debian.org>
Date: Sat, 14 May 2022 00:34:45 +0800
Subject: fix an incorrect IO error reading SMART status
---
atasmart.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/atasmart.c b/atasmart.c
index b054242..9244c45 100644
--- a/atasmart.c
+++ b/atasmart.c
@@ -923,10 +923,10 @@ int sk_disk_smart_status(SkDisk *d, SkBool *good) {
/* SAT/USB bridges truncate packets, so we only check for 4F,
* not for 2C on those */
if ((d->type == SK_DISK_TYPE_ATA_PASSTHROUGH_12 || cmd[3] == htons(0x00C2U)) &&
- cmd[4] == htons(0x4F00U))
+ (cmd[4] & htons(0xFF00U)) == htons(0x4F00U))
*good = TRUE;
else if ((d->type == SK_DISK_TYPE_ATA_PASSTHROUGH_12 || cmd[3] == htons(0x002CU)) &&
- cmd[4] == htons(0xF400U))
+ (cmd[4] & htons(0xFF00U)) == htons(0xF400U))
*good = FALSE;
else {
errno = EIO;

View File

@ -1,92 +0,0 @@
From: Martin Pitt <martin.pitt@ubuntu.com>
Date: Fri, 19 Mar 2010 14:56:06 +0100
Subject: [PATCH 2/2] Drop our own "many bad sectors" heuristic
This currently causes a lot of false positives, because in many cases our
threshold is either overly pessimistically low, or the raw value is implausibly
high. Just use the normalized values vs. threshold for now.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=25772
Bug-Ubuntu: https://launchpad.net/bugs/438136
---
atasmart.c | 34 +++++++++++-----------------------
1 file changed, 11 insertions(+), 23 deletions(-)
diff --git a/atasmart.c b/atasmart.c
index 9244c45..a5b349d 100644
--- a/atasmart.c
+++ b/atasmart.c
@@ -130,6 +130,8 @@ struct SkDisk {
SkBool current_pending_sector_found:1;
uint64_t reallocated_sector_count;
uint64_t current_pending_sector;
+ SkBool reallocated_sector_count_bad:1;
+ SkBool current_pending_sector_bad:1;
void *blob;
};
@@ -2190,16 +2192,23 @@ static void fill_cache_cb(SkDisk *d, const SkSmartAttributeParsedData *a, void*
if (a->pretty_unit != SK_SMART_ATTRIBUTE_UNIT_SECTORS)
return;
+ if (!a->current_value_valid)
+ return;
+
if (!strcmp(a->name, "reallocated-sector-count")) {
if (a->pretty_value > d->reallocated_sector_count)
d->reallocated_sector_count = a->pretty_value;
d->reallocated_sector_count_found = TRUE;
+ if (a->good_now_valid && !a->good_now)
+ d->reallocated_sector_count_bad = TRUE;
}
if (!strcmp(a->name, "current-pending-sector")) {
if (a->pretty_value > d->current_pending_sector)
d->current_pending_sector = a->pretty_value;
d->current_pending_sector_found = TRUE;
+ if (a->good_now_valid && !a->good_now)
+ d->current_pending_sector_bad = TRUE;
}
}
@@ -2255,24 +2264,9 @@ const char* sk_smart_overall_to_string(SkSmartOverall overall) {
return _P(map[overall]);
}
-static uint64_t u64log2(uint64_t n) {
- unsigned r;
-
- if (n <= 1)
- return 0;
-
- r = 0;
- for (;;) {
- n = n >> 1;
- if (!n)
- return r;
- r++;
- }
-}
-
int sk_disk_smart_get_overall(SkDisk *d, SkSmartOverall *overall) {
SkBool good;
- uint64_t sectors, sector_threshold;
+ uint64_t sectors;
assert(d);
assert(overall);
@@ -2293,13 +2287,7 @@ int sk_disk_smart_get_overall(SkDisk *d, SkSmartOverall *overall) {
return -1;
sectors = 0;
} else {
-
- /* We use log2(n_sectors)*1024 as a threshold here. We
- * had to pick something, and this makes a bit of
- * sense, or doesn't it? */
- sector_threshold = u64log2(d->size/512) * 1024;
-
- if (sectors >= sector_threshold) {
+ if (d->reallocated_sector_count_bad || d->current_pending_sector_bad) {
*overall = SK_SMART_OVERALL_BAD_SECTOR_MANY;
return 0;
}

View File

@ -1,2 +0,0 @@
0001-Dont-test-undefined-bits.patch
0002-Drop-our-own-many-bad-sectors-heuristic.patch

View File

@ -1 +1 @@
3.0 (quilt)
3.0 (native)