lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20070214105522.GA23203@duck.suse.cz>
Date:	Wed, 14 Feb 2007 11:55:22 +0100
From:	Jan Kara <jack@...e.cz>
To:	OGAWA Hirofumi <hirofumi@...l.parknet.co.jp>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] FAT: DIO-write fallback to normal buffered

On Sat 10-02-07 23:44:01, OGAWA Hirofumi wrote:
> [RESEND: forget to add linux-kernel@...r.kernel.org]
> 
> If the DIO write on FAT is expanding the size, it will be fail by -EINVAL,
> because FAT can't handle it now.
> 
> This patch fallback it to the normal buffered-write and would return
> success.
> 
> Signed-off-by: OGAWA Hirofumi <hirofumi@...l.parknet.co.jp>
  Signed-off-by: Jan Kara <jack@...e.cz>

  Just to explain a bit: I think that returning EINVAL is quite unexpected
for users in this case (I actually got a bugreport which turned out to be
this problem) and fallback to buffered IO seems to be a reasonable thing to
do. Probably it's not the cleanest solution but for FAT I think it's good
enough ;).

								Honza

> ---
> 
>  fs/fat/inode.c |    4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff -puN fs/fat/inode.c~fat_direct-io-fallback fs/fat/inode.c
> --- linux-2.6/fs/fat/inode.c~fat_direct-io-fallback	2007-02-10 22:08:33.000000000 +0900
> +++ linux-2.6-hirofumi/fs/fat/inode.c	2007-02-10 22:08:33.000000000 +0900
> @@ -173,10 +173,12 @@ static ssize_t fat_direct_IO(int rw, str
>  		 *
>  		 * But we must fill the remaining area or hole by nul for
>  		 * updating ->mmu_private.
> +		 *
> +		 * Return 0, and fallback to normal buffered write.
>  		 */
>  		loff_t size = offset + iov_length(iov, nr_segs);
>  		if (MSDOS_I(inode)->mmu_private < size)
> -			return -EINVAL;
> +			return 0;
>  	}
>  
>  	/*
> _
-- 
Jan Kara <jack@...e.cz>
SuSE CR Labs
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ