[PATCH] ioctl: implement NBD_* ioctl decoding
Dmitry V. Levin
ldv at altlinux.org
Sat Sep 22 10:46:48 UTC 2018
On Sat, Sep 22, 2018 at 11:52:29AM +0200, Elvira Khabirova wrote:
> On Fri, 21 Sep 2018 22:39:29 +0200, Eugene Syromiatnikov <esyr at redhat.com> wrote:
> > On Fri, Sep 21, 2018 at 04:42:50PM +0200, Elvira Khabirova wrote:
> > > + ioctl(-1, NBD_SET_FLAGS, 0);
> > > + printf("ioctl(-1, NBD_SET_FLAGS, 0) = -1 EBADF (%m)\n");
> > > + ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_HAS_FLAGS);
> > > + printf("ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_HAS_FLAGS) = -1 EBADF (%m)\n");
> > > + ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_READ_ONLY);
> > > + printf("ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_READ_ONLY) = -1 EBADF (%m)\n");
> > > + ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_SEND_FLUSH);
> > > + printf("ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_SEND_FLUSH) = -1 EBADF (%m)\n");
> > > + ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_SEND_FUA);
> > > + printf("ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_SEND_FUA) = -1 EBADF (%m)\n");
> > > + ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_SEND_TRIM);
> > > + printf("ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_SEND_TRIM) = -1 EBADF (%m)\n");
> > > + ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_CAN_MULTI_CONN);
> > > + printf("ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_CAN_MULTI_CONN) = -1 EBADF (%m)\n");
> >
> > It is probably worth checking various flag combinations, including bits
> > for which there are no constants defined, in order to avoid situation like
> > v4.21~159.
>
> Could you elaborate?
I suppose Eugene means that one has to specify at least two flags,
e.g. NBD_FLAG_HAS_FLAGS|NBD_FLAG_READ_ONLY
to distinguish printflags() from printxval() in the parser.
--
ldv
More information about the Strace-devel
mailing list