linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 3/3] fat: warn when discard request fails other than EOPNOTSUPP
@ 2012-11-03  6:28 Namjae Jeon
  2012-11-05 10:53 ` OGAWA Hirofumi
  0 siblings, 1 reply; 3+ messages in thread
From: Namjae Jeon @ 2012-11-03  6:28 UTC (permalink / raw)
  To: hirofumi, akpm; +Cc: linux-fsdevel, linux-kernel, Namjae Jeon, Amit Sahrawat

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

Signed-off-by: Namjae Jeon <linkinjeon@gmail.com>
Signed-off-by: Amit Sahrawat <amit.sahrawat83@gmail.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;
 			}
 		}
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2 3/3] fat: warn when discard request fails other than EOPNOTSUPP
  2012-11-03  6:28 [PATCH v2 3/3] fat: warn when discard request fails other than EOPNOTSUPP Namjae Jeon
@ 2012-11-05 10:53 ` OGAWA Hirofumi
  2012-11-11 11:39   ` Namjae Jeon
  0 siblings, 1 reply; 3+ messages in thread
From: OGAWA Hirofumi @ 2012-11-05 10:53 UTC (permalink / raw)
  To: Namjae Jeon; +Cc: akpm, linux-fsdevel, linux-kernel, Amit Sahrawat

Namjae Jeon <linkinjeon@gmail.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@gmail.com>
> Signed-off-by: Amit Sahrawat <amit.sahrawat83@gmail.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@mail.parknet.co.jp>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2 3/3] fat: warn when discard request fails other than EOPNOTSUPP
  2012-11-05 10:53 ` OGAWA Hirofumi
@ 2012-11-11 11:39   ` Namjae Jeon
  0 siblings, 0 replies; 3+ messages in thread
From: Namjae Jeon @ 2012-11-11 11:39 UTC (permalink / raw)
  To: OGAWA Hirofumi; +Cc: akpm, linux-fsdevel, linux-kernel, Amit Sahrawat

2012/11/5 OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>:
> Namjae Jeon <linkinjeon@gmail.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?
Yes, maybe it will be better than doing in filesystem.
I will check more.
Thanks.
>
>> Signed-off-by: Namjae Jeon <linkinjeon@gmail.com>
>> Signed-off-by: Amit Sahrawat <amit.sahrawat83@gmail.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@mail.parknet.co.jp>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-11-11 11:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-03  6:28 [PATCH v2 3/3] fat: warn when discard request fails other than EOPNOTSUPP Namjae Jeon
2012-11-05 10:53 ` OGAWA Hirofumi
2012-11-11 11:39   ` Namjae Jeon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).