[PATCH v2] Decode /dev/loop ioctls
Dmitry V. Levin
ldv at altlinux.org
Wed May 2 15:58:34 UTC 2012
On Wed, May 02, 2012 at 11:54:19AM -0400, Mike Frysinger wrote:
> On Wednesday 02 May 2012 06:38:44 Dmitry V. Levin wrote:
> > On Wed, May 02, 2012 at 02:09:55PM +0400, Dmitry V. Levin wrote:
> > > On Tue, Apr 17, 2012 at 10:19:31PM -0400, Mike Frysinger wrote:
> > > > Needed to debug some losetup failures, and it's easier when you can see
> > > > what the kernel is getting vs what you think you're sending, so add
> > > > some decoders for those ioctls.
> > > >
> > > > * defs.h (loop_ioctl): New prototype.
> > > > (string_quote): Likewise.
> > > > * ioctl.c (ioctl_decode): Call loop_ioctl when code is 'L'.
> > > > * Makefile.am (strace_SOURCES): Add loop.c.
> > > > * loop.c: New file.
> > > > * util.c (string_quote): Delete static keyword
> > >
> > > On a system with quite old <linux/loop.h> file from some 2.6.18-derived
> > > kernel headers I've got a build failure:
> > >
> > > loop.c:36:4: error: 'LO_FLAGS_AUTOCLEAR' undeclared here (not in a
> > > function) loop.c: In function 'loop_ioctl':
> > > loop.c:167:7: error: 'LOOP_SET_CAPACITY' undeclared (first use in this
> > > function) loop.c:167:7: note: each undeclared identifier is reported
> > > only once for each function it appears in
> > I've pushed a fix.
> i'm not sure if the configure test is really needed. seems like overkill since
> we're going to be using #ifdef in the source regardless.
Not all these constants could be #ifdef'ed directly. For example,
LO_FLAGS_AUTOCLEAR and LO_FLAGS_PARTSCAN are enums. The build fix also
fixed LO_FLAGS_PARTSCAN recognition on systems where it is defined.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 198 bytes
Desc: not available
More information about the Strace-devel