--- zzzz-none-000/linux-4.4.60/fs/open.c 2017-04-08 07:53:53.000000000 +0000 +++ dragonfly-4020-701/linux-4.4.60/fs/open.c 2018-11-08 13:36:17.000000000 +0000 @@ -673,7 +673,9 @@ { /* NB: we're sure to have correct a_ops only after f_op->open */ if (f->f_flags & O_DIRECT) { +#ifdef CONFIG_DIRECT_IO if (!f->f_mapping->a_ops || !f->f_mapping->a_ops->direct_IO) +#endif return -EINVAL; } return 0;