lkml.org 
[lkml]   [2015]   [Nov]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 3/4] nvdimm: Add IOCTL pass thru
Date
Jerry Hoemann <jerry.hoemann@hpe.com> writes:

> @@ -633,10 +718,11 @@ static int match_dimm(struct device *dev, void *data)
>
> static long nvdimm_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
> {
> - int rc = -ENXIO, read_only;
> + int rc = -ENXIO, ro;
> struct nvdimm_bus *nvdimm_bus;
> + unsigned int type = _IOC_TYPE(cmd);
>
> - read_only = (O_RDWR != (file->f_flags & O_ACCMODE));
> + ro = (O_RDWR != (file->f_flags & O_ACCMODE));

I'm still reviewing the rest of this, but this is bugging me. The
existing check for read_only looks pretty fishy to me. O_WRONLY is a
thing (even though it's probably not a supportable mode for this ioctl).
Why not just check for O_RDONLY?

Cheers,
Jeff


\
 
 \ /
  Last update: 2015-11-10 17:41    [W:0.098 / U:1.364 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site