Re: [PATCH] Use of getblk differs between locations

From: Jeff Mahoney (jeffm_at_suse.com)
Date: 10/12/05

  • Next message: Lee Revell: "Re: 2.6.14-rc4-rt1"
    Date:	Wed, 12 Oct 2005 15:51:14 -0400
    To: Anton Altaparmakov <aia21@cam.ac.uk>
    
    

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

    Anton Altaparmakov wrote:
    > On Tue, 2005-10-11 at 00:49 +0200, Mikulas Patocka wrote:
    >> On Mon, 10 Oct 2005, Anton Altaparmakov wrote:
    >>> On Mon, 10 Oct 2005, Mikulas Patocka wrote:
    >>>> On Mon, 10 Oct 2005, Glauber de Oliveira Costa wrote:
    >>>> As comment in buffer.c says, getblk will deadlock if the machine is out of
    >>>> memory. It is questionable whether to deadlock or return NULL and corrupt
    >>>> filesystem in this case --- deadlock is probably better.
    >>> What do you mean corrupt filesystem? If a filesystem is written so badly
    >>> that it will cause corruption when a NULL is returned somewhere, I
    >>> certainly don't want to have anything to do with it.
    >> 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

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

    iD8DBQFDTWkyLPWxlyuTD7IRAg0lAJ4yoTfJPgBFPgrT7LaIOdKfN7hFCACfXVSC
    685SGzxL2pGMnAySooeNaxk=
    =9Wfm
    -----END PGP SIGNATURE-----
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/


  • Next message: Lee Revell: "Re: 2.6.14-rc4-rt1"

    Relevant Pages

    • Re: [PATCH] Use of getblk differs between locations
      ... >> I recently looked into 2) a bit and the dm multipath code is almost ... > - displaying dialog window needs memory, so it waits until memory will ... Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: reiser4 plugins
      ... > 'kool' that its going to get into the kernel without rigorous peer ... I did expect the peer review to be a little more efficient, ... Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: Possible GPL Violation of Linux in Amstrads E3 Videophone
      ... |>At least in New York and California the owner of intellectual ... enough kernel developers to relicense under such terms is the day hell ... Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • wakeup_pmode_return jmp failing?
      ... 352-5299 voice ... and may not represent the views of Sun Microsystems, ... Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • [off-topic] Patrick K. a new list subscriber
      ... university study (informatics of course). ... my prefered coding language is C and Java with the vi. ... Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)