From: Jeff Moyer <jmoyer@redhat.com>
To: Jerry Hoemann <jerry.hoemann@hpe.com>
Cc: ross.zwisler@linux.intel.com, rjw@rjwysocki.net, lenb@kernel.org,
dan.j.williams@intel.com, linux-acpi@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-nvdimm@ml01.01.org
Subject: Re: [PATCH 3/4] nvdimm: Add IOCTL pass thru
Date: Tue, 10 Nov 2015 11:24:47 -0500 [thread overview]
Message-ID: <x49io59lt4g.fsf@segfault.boston.devel.redhat.com> (raw)
In-Reply-To: <2792786733bc18d561ca352d7a642b3989a370fa.1446684001.git.jerry.hoemann@hpe.com> (Jerry Hoemann's message of "Fri, 6 Nov 2015 15:27:30 -0700")
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
next prev parent reply other threads:[~2015-11-10 16:24 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-06 22:27 [PATCH 0/4] nvdimm: Add an IOCTL pass thru for DSM calls Jerry Hoemann
2015-11-06 22:27 ` [PATCH 1/4] nvdimm: Add wrapper for IOCTL pass thru Jerry Hoemann
2015-11-10 17:51 ` Jeff Moyer
2015-11-10 18:05 ` Dan Williams
2015-11-10 19:49 ` Jerry Hoemann
2015-11-10 20:26 ` Jeff Moyer
2015-11-11 0:44 ` Jerry Hoemann
2015-11-11 0:49 ` Dan Williams
2015-11-11 15:47 ` Jeff Moyer
2015-11-10 20:27 ` Dan Williams
2015-11-10 20:53 ` Linda Knippers
2015-11-10 22:20 ` Dan Williams
2015-11-10 19:04 ` Elliott, Robert (Persistent Memory)
2015-11-10 21:25 ` Jerry Hoemann
2015-11-06 22:27 ` [PATCH 2/4] nvdimm: Add " Jerry Hoemann
2015-11-10 18:05 ` Jeff Moyer
2015-11-10 22:13 ` Jerry Hoemann
2015-11-11 15:41 ` Jeff Moyer
2015-11-06 22:27 ` [PATCH 3/4] " Jerry Hoemann
2015-11-10 16:24 ` Jeff Moyer [this message]
2015-11-10 21:36 ` Jerry Hoemann
2015-11-10 21:45 ` Jeff Moyer
2015-11-10 22:15 ` Jerry Hoemann
2015-11-10 21:54 ` Jeff Moyer
2015-11-11 1:42 ` Jerry Hoemann
2015-11-06 22:27 ` [PATCH 4/4] nvdimm: rename functions that aren't IOCTL passthru Jerry Hoemann
2015-11-10 15:33 ` [PATCH 0/4] nvdimm: Add an IOCTL pass thru for DSM calls Jeff Moyer
2015-11-10 21:39 ` Jerry Hoemann
-- strict thread matches above, loose matches on Subject: below --
2015-11-07 14:02 [PATCH 3/4] nvdimm: Add IOCTL pass thru Dmitry Krivenok
2015-11-09 21:59 ` Jerry Hoemann
2015-11-10 15:05 ` Dmitry Krivenok
2015-11-11 21:44 ` Jerry Hoemann
2015-11-11 21:52 ` Dmitry Krivenok
2015-11-12 15:33 ` Jerry Hoemann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=x49io59lt4g.fsf@segfault.boston.devel.redhat.com \
--to=jmoyer@redhat.com \
--cc=dan.j.williams@intel.com \
--cc=jerry.hoemann@hpe.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvdimm@ml01.01.org \
--cc=rjw@rjwysocki.net \
--cc=ross.zwisler@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox