--- zzzz-none-000/linux-4.4.60/fs/open.c 2017-04-08 07:53:53.000000000 +0000 +++ scorpion-7490-727/linux-4.4.60/fs/open.c 2021-02-04 17:41:59.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;