Re: [PATCH v2 3/4] cachestat: implement cachestat syscall

Al Viro
2022-12-10T23:56:10Z

On Mon, Dec 05, 2022 at 09:51:39AM -0800, Nhat Pham wrote:

> + if (!access_ok(cstat, sizeof(struct cachestat)))
> + return -EFAULT;

What for? You are using copy_to_user() later, right?

> + f = fdget(fd);
> + if (f.file) {

It would be easier to read if you inverted the condition here.