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] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 05 Nov 2012 19:53:50 +0900
From:	OGAWA Hirofumi <hirofumi@...l.parknet.co.jp>
To:	Namjae Jeon <linkinjeon@...il.com>
Cc:	akpm@...ux-foundation.org, linux-fsdevel@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	Amit Sahrawat <amit.sahrawat83@...il.com>
Subject: Re: [PATCH v2 3/3] fat: warn when discard request fails other than EOPNOTSUPP

Namjae Jeon <linkinjeon@...il.com> writes:

> FAT also warn user then the discard request fails
> as ext4(http://patchwork.ozlabs.org/patch/192669/)

Why don't we do this at block layer like normal bio?

> Signed-off-by: Namjae Jeon <linkinjeon@...il.com>
> Signed-off-by: Amit Sahrawat <amit.sahrawat83@...il.com>
> ---
>  fs/fat/fatent.c |   15 +++++++++------
>  1 file changed, 9 insertions(+), 6 deletions(-)
>
> diff --git a/fs/fat/fatent.c b/fs/fat/fatent.c
> index 260705c..fc1f407 100644
> --- a/fs/fat/fatent.c
> +++ b/fs/fat/fatent.c
> @@ -583,12 +583,15 @@ int fat_free_clusters(struct inode *inode, int cluster)
>  			 */
>  			if (cluster != fatent.entry + 1) {
>  				int nr_clus = fatent.entry - first_cl + 1;
> -
> -				sb_issue_discard(sb,
> -					fat_clus_to_blknr(sbi, first_cl),
> -					nr_clus * sbi->sec_per_clus,
> -					GFP_NOFS, 0);
> -
> +				sector_t sblk = fat_clus_to_blknr(sbi, first_cl);
> +				sector_t nrblk = nr_clus * sbi->sec_per_clus;
> +
> +				err = sb_issue_discard(sb,
> +						sblk, nrblk, GFP_NOFS, 0);
> +				if (err && err != -EOPNOTSUPP)
> +					fat_msg(sb, KERN_WARNING, "discard request for"
> +							" block:%llu count:%llu failed"
> +							" with %d", sblk, nrblk, err);
>  				first_cl = cluster;
>  			}
>  		}

-- 
OGAWA Hirofumi <hirofumi@...l.parknet.co.jp>
--
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