Re: [PATCH v2 3/3] fat: warn when discard request fails other than EOPNOTSUPP

2 messages, 2 authors, 2012-11-11 · open the first message on its own page

Re: [PATCH v2 3/3] fat: warn when discard request fails other than EOPNOTSUPP

From: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Date: 2012-11-05 10:53:50

Namjae Jeon [off-list ref] 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?
quoted hunk
Signed-off-by: Namjae Jeon <redacted>
Signed-off-by: Amit Sahrawat <redacted>
---
 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 [off-list ref]

Re: [PATCH v2 3/3] fat: warn when discard request fails other than EOPNOTSUPP

From: Namjae Jeon <hidden>
Date: 2012-11-11 11:39:26

2012/11/5 OGAWA Hirofumi [off-list ref]:
Namjae Jeon [off-list ref] writes:
quoted
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.
quoted
Signed-off-by: Namjae Jeon <redacted>
Signed-off-by: Amit Sahrawat <redacted>
---
 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 [off-list ref]
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help