Re: get_block after EOF
From: Josef Moellers (josef.moellers_at_fujitsu-siemens.com)
Date: 12/06/04
- Next message: Kasper Dupont: "Re: get_block after EOF"
- Previous message: mgodoy_at_entel.cl: "Migrating a 32 bit aplication to a 64 bit processor, using gcc in Linux platform."
- In reply to: Kasper Dupont: "get_block after EOF"
- Next in thread: Kasper Dupont: "Re: get_block after EOF"
- Reply: Kasper Dupont: "Re: get_block after EOF"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 06 Dec 2004 16:24:02 +0100
Kasper Dupont wrote:
> I have a file system that is implemented using a
> get_block function. How should such a get_block
> function behave if given a block number outside
> the file? Right now my get_block function is
> probably going to return garbage if that happens.
>
> What is the right way to behave? I can think of a
> few different possibilities.
>
> - Return 0 without calling map_bh
> - Return -EIO
> - Print an error message to the kernel log and
> return -EIO
> - BUG
> - Panic
>
It depends ...
If this Should Not Happen, then Panic would be The Right Thing (BUG
might only kill the current thread who may or may not be responsible for
the mishap).
If this might happen, return 0, but print an error message to the log.
EIO means that some IO error has taken place. Being requested to read a
(logically) non-existent block is no IO error.
-- Josef Möllers (Pinguinpfleger bei FSC) If failure had no penalty success would not be a prize -- T. Pratchett
- Next message: Kasper Dupont: "Re: get_block after EOF"
- Previous message: mgodoy_at_entel.cl: "Migrating a 32 bit aplication to a 64 bit processor, using gcc in Linux platform."
- In reply to: Kasper Dupont: "get_block after EOF"
- Next in thread: Kasper Dupont: "Re: get_block after EOF"
- Reply: Kasper Dupont: "Re: get_block after EOF"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|