lkml.org 
[lkml]   [2015]   [Apr]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] udf: return correct errno for udf_update_inode()
On Sun 22-03-15 19:17:49, Changwoo Min wrote:
> Instead of -ENOMEM, properly return -EIO udf_update_inode()
> error, similar/consistent to the rest of filesystems.
>
> Signed-off-by: Changwoo Min <changwoo.m@gmail.com>
So I actually had a look how we treat results from udf_tgetblk(). The
truth is:
Once we return ENOMEM. Once we return EIO. Once we just return NULL from
the function and it will get eventually translated to something like EIO.
Once we just crash. Twice we just ignore the problem (as it is during
readahead). So saying there is any consistency among the callers of
udf_tgetblk() is just wrong.

But looking into when getblk() can fail to return the buffer, EIO is
probably a better return value. So I've take the patch.

Honza
>
> ---
> fs/udf/inode.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/udf/inode.c b/fs/udf/inode.c
> index a445d59..c758023 100644
> --- a/fs/udf/inode.c
> +++ b/fs/udf/inode.c
> @@ -1637,7 +1637,7 @@ static int udf_update_inode(struct inode *inode, int do_sync)
> udf_get_lb_pblock(inode->i_sb, &iinfo->i_location, 0));
> if (!bh) {
> udf_debug("getblk failure\n");
> - return -ENOMEM;
> + return -EIO;
> }
>
> lock_buffer(bh);
> --
> 1.9.1
>
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR


\
 
 \ /
  Last update: 2015-04-01 13:21    [W:0.067 / U:0.492 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site