mirror of https://github.com/schoebel/mars
bio: fix wrong detection of error
This commit is contained in:
parent
9d491ae27c
commit
c7f8d856ee
|
@ -663,9 +663,10 @@ static int bio_switch(struct bio_brick *brick)
|
||||||
brick->filp = filp_open(path, flags, prot);
|
brick->filp = filp_open(path, flags, prot);
|
||||||
set_fs(oldfs);
|
set_fs(oldfs);
|
||||||
|
|
||||||
if (!brick->filp) {
|
if (unlikely(!brick->filp || IS_ERR(brick->filp))) {
|
||||||
MARS_ERR("cannot open '%s'\n", path);
|
status = PTR_ERR(brick->filp);
|
||||||
status = -ENOENT;
|
brick->filp = NULL;
|
||||||
|
MARS_ERR("cannot open '%s', status = %d\n", path, status);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue