Allow upper layers to discover than BIO_DELETE and/or BIO_FLUSH is not
supported by returning EOPNOTSUPP instead of 0 or ENODEV. MFC after: 3 days
This commit is contained in:
parent
2536f7a375
commit
2f532a77b7
@ -305,7 +305,7 @@ g_disk_start(struct bio *bp)
|
||||
switch(bp->bio_cmd) {
|
||||
case BIO_DELETE:
|
||||
if (!(dp->d_flags & DISKFLAG_CANDELETE)) {
|
||||
error = 0;
|
||||
error = EOPNOTSUPP;
|
||||
break;
|
||||
}
|
||||
/* fall-through */
|
||||
@ -394,8 +394,8 @@ g_disk_start(struct bio *bp)
|
||||
g_trace(G_T_TOPOLOGY, "g_disk_flushcache(%s)",
|
||||
bp->bio_to->name);
|
||||
if (!(dp->d_flags & DISKFLAG_CANFLUSHCACHE)) {
|
||||
g_io_deliver(bp, ENODEV);
|
||||
return;
|
||||
error = EOPNOTSUPP;
|
||||
break;
|
||||
}
|
||||
bp2 = g_clone_bio(bp);
|
||||
if (bp2 == NULL) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user