diff options
author | Mateusz Grzonka <mateusz.grzonka@intel.com> | 2021-11-24 11:48:33 +0100 |
---|---|---|
committer | Jes Sorensen <jsorensen@fb.com> | 2021-11-24 13:07:12 +0100 |
commit | b71de056cec70784ef2727e2febd7a6c88e580db (patch) | |
tree | a9c39829732f54c378dcd334b78097e8e4a17c6e /super-ddf.c | |
parent | Incremental: Close unclosed mdfd in IncrementalScan() (diff) | |
download | mdadm-b71de056cec70784ef2727e2febd7a6c88e580db.tar.xz mdadm-b71de056cec70784ef2727e2febd7a6c88e580db.zip |
Correct checking if file descriptors are valid
In some cases file descriptors equal to 0 are treated as invalid.
Fix it.
Signed-off-by: Mateusz Grzonka <mateusz.grzonka@intel.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
Diffstat (limited to '')
-rw-r--r-- | super-ddf.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/super-ddf.c b/super-ddf.c index d334a79d..3f304cdc 100644 --- a/super-ddf.c +++ b/super-ddf.c @@ -4914,7 +4914,7 @@ static int raid10_degraded(struct mdinfo *info) pr_err("BUG: invalid raid disk\n"); goto out; } - if (d->state_fd > 0) + if (is_fd_valid(d->state_fd)) found[i]++; } ret = 2; |