diff --git a/libstorage/fs.c b/libstorage/fs.c index 6895a593..6a7d842e 100644 --- a/libstorage/fs.c +++ b/libstorage/fs.c @@ -75,10 +75,12 @@ void storage_fsHandler(void *data, msg_t *msg) case mtDevCtl: if (fs->ops->devctl == NULL) { - msg->o.io.err = -ENOSYS; + /* FIXME this error passing works by accident on ioctl(), + * there's no dedicated error field for devctl. */ + msg->o.io.err = -ENOTTY; /* To return valid errno on ioctl() */ break; } - (void)fs->ops->devctl(fs->info, &msg->i.io.oid, msg->i.raw, msg->o.raw); + fs->ops->devctl(fs->info, &msg->i.io.oid, msg->i.raw, msg->o.raw); break; case mtCreate: diff --git a/libstorage/include/storage/fs.h b/libstorage/include/storage/fs.h index 17ad1f4e..30650247 100644 --- a/libstorage/include/storage/fs.h +++ b/libstorage/include/storage/fs.h @@ -32,7 +32,7 @@ typedef struct { int (*setattr)(void *info, oid_t *oid, int type, long long attr, void *data, size_t len); int (*getattr)(void *info, oid_t *oid, int type, long long *attr); int (*truncate)(void *info, oid_t *oid, size_t size); - int (*devctl)(void *info, oid_t *oid, const void *in, void *out); + void (*devctl)(void *info, oid_t *oid, const void *in, void *out); int (*create)(void *info, oid_t *oid, const char *name, oid_t *dev, unsigned mode, int type, oid_t *res); int (*destroy)(void *info, oid_t *oid);