Skip to contentSkip to conversation

mkfs error: "existing superblock read failed: Inappropriate ioctl for device"

DISCUSSION Alexander Tsvetkov 2 participants 2 messages Mar 26, 2015

lore
Share & tools
lore
#0 lore raw

Hello,

I have the following error message: "existing superblock read failed: Inappropriate ioctl for device" after attempt to make xfs image with "mkfs.xfs -f -m crc=1 -d file=1,name=xfs.fs,size=32m":

"meta-data=xfs.fs isize=256 agcount=2, agsize=4096 blks

         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=0        finobt=0
data     =                       bsize=4096   blocks=8192, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=0
log      =internal log           bsize=4096   blocks=853, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0

existing superblock read failed: Inappropriate ioctl for device"

Filesystem is created and mounted as usually, xfs_repair passes, no messages in the system log.
Configuration: Fedora 20 x86_64 on vbox, kernel 4.0.0-rc5, xfsprogs version 3.2.2.

Thanks,
Alexander Tsvetkov

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#1 lore raw
Quoted 16 lines · Alexander Tsvetkov

Hello,

I have the following error message: "existing superblock read failed:
Inappropriate ioctl for device"
after attempt to make xfs image with "mkfs.xfs -f -m crc=1 -d file=1,name=xfs.fs,size=32m":

"meta-data=xfs.fs isize=256 agcount=2, agsize=4096 blks

         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=0        finobt=0
data     =                       bsize=4096   blocks=8192, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=0
log      =internal log           bsize=4096   blocks=853, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
Quoted 7 lines

existing superblock read failed: Inappropriate ioctl for device"

Filesystem is created and mounted as usually, xfs_repair passes, no messages in the system log.
Configuration: Fedora 20 x86_64 on vbox, kernel 4.0.0-rc5, xfsprogs version 3.2.2.

This appears to come from zero_old_xfs_structures() where we try and zero out any old data structures on the target device. pread() of the superblock returns 0, because we open the target with O_CREAT|O_TRUNC if it is a file (e.g., the file size is 0 so any reads will return 0). It's not an error, so I suspect the error string there is stale from a previous operation. Indeed, from strace:

...
ioctl(3, BLKDISCARD, {0, 7ffc2904a180}) = -1 ENOTTY (Inappropriate ioctl for device)
...
write(2, "existing superblock read failed:"..., 64existing superblock read failed: Inappropriate ioctl for device ) = 64
...

I'll send a patch in a bit, but the short of it is that this is harmless. The side effect is we skip out of the function that zeroes old metadata, but the file has already been truncated and thus effectively zeroed out.

Brian

Quoted 8 lines

Thanks,
Alexander Tsvetkov

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs