public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Brian Foster <bfoster@redhat.com>
To: Alexander Tsvetkov <alexander.tsvetkov@oracle.com>
Cc: xfs@oss.sgi.com
Subject: Re: mkfs error: "existing superblock read failed: Inappropriate ioctl for device"
Date: Thu, 26 Mar 2015 11:25:23 -0400	[thread overview]
Message-ID: <20150326152522.GA38652@bfoster.bfoster> (raw)
In-Reply-To: <55140956.1050108@oracle.com>

On Thu, Mar 26, 2015 at 04:27:50PM +0300, Alexander Tsvetkov wrote:
> 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.
> 

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

> Thanks,
> Alexander Tsvetkov
> 
> 
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

      reply	other threads:[~2015-03-26 15:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-26 13:27 mkfs error: "existing superblock read failed: Inappropriate ioctl for device" Alexander Tsvetkov
2015-03-26 15:25 ` Brian Foster [this message]

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=20150326152522.GA38652@bfoster.bfoster \
    --to=bfoster@redhat.com \
    --cc=alexander.tsvetkov@oracle.com \
    --cc=xfs@oss.sgi.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