All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Lyakas <alex.bolshoy@gmail.com>
To: linux-fsdevel@vger.kernel.org
Subject: vfs_writev() returns -EIO, although no errors are returned from the underlying device
Date: Tue, 13 Mar 2012 22:09:22 +0200	[thread overview]
Message-ID: <CAGRgLy6TmPT8uZ3Eq9WgEV6_UsySQ0S8ZvU318jM8cp2uVe6RQ@mail.gmail.com> (raw)

Greetings all,
I apologize if my question should not have been posted to this list.

I am working with code that issues vfs_writev() to a fd, which was
opened using filp_open(). The pathname, which has been opened, is a
DeviceMapper devnode (like /dev/dm-1), which is a linear DeviceMapper
mapped to a local drive.

At some point, I switch the DeviceMapper to "error" table (using
"dmsetup reload" and then "dmsetup resume"). As expected,
vfs_writev() starts returning -EIO.

Then later, I switch the DeviceMapper back to "linear" table mapped to
the same local drive. However, the vfs_writev() still returns -EIO
several times, before it starts completing successfully. If do a
direct IO at this point to the DM device (like dd if=/dev/urandom
of=/dev/dm-1 oflag=direct), I don't hit any IO errors. I also added
some prints to dm-linear code, and verified that it does not return
any IO errors at this point. So it seems that the VFS layer somehow
"remembers" that previously there were IO errors from that device.

I started digging in the kernel code to get some clue on this, but at
this point I only saw functions like make_bad_inode() and
is_bad_inode(), which may be relevant somehow, but I was not able to
trace where the -EIO is returned from.

Can someone pls point me which code I should look at to debug this
issue. I am running kernel 2.6.38-8 (stock ubuntu natty). Any clue is
appreciated.

Thanks,
  Alex.

             reply	other threads:[~2012-03-13 20:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-13 20:09 Alexander Lyakas [this message]
2012-03-16  9:44 ` vfs_writev() returns -EIO, although no errors are returned from the underlying device Jan Kara
2012-03-18 15:35   ` Alexander Lyakas
2012-03-19  9:34     ` Jan Kara
2012-03-21  9:17       ` Alexander Lyakas

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=CAGRgLy6TmPT8uZ3Eq9WgEV6_UsySQ0S8ZvU318jM8cp2uVe6RQ@mail.gmail.com \
    --to=alex.bolshoy@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.