public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeff Mahoney <jeffm@suse.com>
To: Mikulas Patocka <mikulas@artax.karlin.mff.cuni.cz>
Cc: Anton Altaparmakov <aia21@cam.ac.uk>,
	Glauber de Oliveira Costa <glommer@br.ibm.com>,
	linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	ext2-devel@lists.sourceforge.net, hirofumi@mail.parknet.co.jp,
	linux-ntfs-dev@lists.sourceforge.net, aia21@cantab.net,
	hch@infradead.org, viro@zeniv.linux.org.uk, akpm@osdl.org
Subject: Re: [PATCH] Use of getblk differs between locations
Date: Wed, 12 Oct 2005 16:07:22 -0400	[thread overview]
Message-ID: <434D6CFA.4080802@suse.com> (raw)
In-Reply-To: <Pine.LNX.4.62.0510122155390.9881@artax.karlin.mff.cuni.cz>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Mikulas Patocka wrote:
>> Anton Altaparmakov wrote:
>>> On Tue, 2005-10-11 at 00:49 +0200, Mikulas Patocka wrote:
>>>> On Mon, 10 Oct 2005, Anton Altaparmakov wrote:
>>>> What should a filesystem driver do if it can't suddenly read or
>>>> write any
>>>> blocks on media?
>>>
>>> Two clear choices:
>>>
>>> 1) Switch to read-only and use the cached data to fulfil requests and
>>> fail all others.
>>>
>>> 2) Ask the user to insert the media/plug the device back in (this is by
>>> far the most likely cause of all requests suddenly failing) and then
>>> continue where they left off.
>>>
>>> It is unfortunate that Linux does not allow for 2) so you need to do 1).
>>
>> I recently looked into 2) a bit and the dm multipath code is almost
>> enough to do exactly this.
>>
>> If you configure your block device as an mpath device that queues on
>> path failure, and change the table to the new device location on device
>> re-attach, the queued up i/o will be flushed out. Almost. Right now,
>> when you change the table and resume the dm mapping, it does a suspend
>> which attempts to write out the data to a device which is no longer
>> there, causing it to just be dropped on the floor. If this were changed
>> not to do that, and perhaps set a timer so that the dirty data wouldn't
>> be left around forever if the device wasn't reattached, 2) would
>> definitely be possible.
>>
>> I realize that the userspace intervention required may involve a bit of
>> dark magic, but my point is most of the code required on the kernel side
>> is already implemented.
>>
>> - -Jeff
> 
> Is memory management ready for this? Can't deadlock like this happen?
> - displaying dialog window needs memory, so it waits until memory will
> be available
> - system decides to write some write-back cached data in order to free
> memory
> - the write of these data waits until the dialog window is displayed,
> user inserts the device and clicks 'OK'

No, it's not, and deadlock is definitely possible. However, if we're at
the point where memory is tight enough that it's an issue, the timer can
expire and all the pending i/o is dropped just as it would be without
the multipath code enabled.

I'm not saying it's a solution ready for production, just a good
starting point.

- -Jeff

- --
Jeff Mahoney
SUSE Labs
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDTWz5LPWxlyuTD7IRAiXRAJ4oRz7NpSrhMxp1ODlJWFsDaBcMsgCfbB8q
3XoPFrF0XHA1NFInVSjRicw=
=Do4z
-----END PGP SIGNATURE-----

  reply	other threads:[~2005-10-12 20:04 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-10 20:45 [PATCH] Use of getblk differs between locations Glauber de Oliveira Costa
2005-10-10 21:20 ` Anton Altaparmakov
2005-10-10 21:46   ` Glauber de Oliveira Costa
2005-10-10 21:58     ` Mikulas Patocka
2005-10-10 22:25       ` Anton Altaparmakov
2005-10-10 22:49         ` Mikulas Patocka
2005-10-10 23:12           ` Glauber de Oliveira Costa
2005-10-10 23:16             ` Mikulas Patocka
2005-10-10 23:33               ` Glauber de Oliveira Costa
2005-10-10 23:34                 ` Mikulas Patocka
2005-10-10 23:49                   ` Glauber de Oliveira Costa
2005-10-11  7:52           ` Anton Altaparmakov
2005-10-12 19:51             ` Jeff Mahoney
2005-10-12 19:59               ` Mikulas Patocka
2005-10-12 20:07                 ` Jeff Mahoney [this message]
2005-10-12 20:12                   ` Mikulas Patocka
2005-10-12 20:14                     ` Anton Altaparmakov
2005-10-12 20:31                       ` Mikulas Patocka
2005-10-12 21:19                         ` Jeff Mahoney
2005-10-12 21:35                         ` Anton Altaparmakov
2005-10-13  0:09                     ` Jamie Lokier
2005-10-13  0:21                       ` Mikulas Patocka
2005-10-13  0:27                         ` Jamie Lokier
2005-10-13 11:17                     ` Pavel Machek
2005-10-14 16:52                       ` Jamie Lokier
2005-10-14 18:26                         ` Mikulas Patocka
2005-10-13  0:05                   ` Jamie Lokier
2005-10-12 20:08               ` Anton Altaparmakov
2005-10-10 22:36       ` Glauber de Oliveira Costa
2005-10-10 22:28         ` Anton Altaparmakov
2005-10-10 23:36           ` Andrew Morton
2005-10-11  0:07             ` Glauber de Oliveira Costa
2005-10-11  0:05               ` Al Viro
2005-10-11  0:40                 ` Glauber de Oliveira Costa
2005-10-11 12:35                   ` Jan Hudec
2005-10-11  0:09             ` Mikulas Patocka
2005-10-11  1:07               ` Andrew Morton
2005-10-11  1:20                 ` Mikulas Patocka
2005-10-11  5:02                   ` Andrew Morton
2005-10-11  8:07                   ` Anton Altaparmakov
2005-10-11  8:01                 ` Anton Altaparmakov
2005-10-13  0:58                   ` Mike Christie

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=434D6CFA.4080802@suse.com \
    --to=jeffm@suse.com \
    --cc=aia21@cam.ac.uk \
    --cc=aia21@cantab.net \
    --cc=akpm@osdl.org \
    --cc=ext2-devel@lists.sourceforge.net \
    --cc=glommer@br.ibm.com \
    --cc=hch@infradead.org \
    --cc=hirofumi@mail.parknet.co.jp \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-ntfs-dev@lists.sourceforge.net \
    --cc=mikulas@artax.karlin.mff.cuni.cz \
    --cc=viro@zeniv.linux.org.uk \
    /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