linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Namjae Jeon <linkinjeon@gmail.com>
To: hirofumi@mail.parknet.co.jp, akpm@linux-foundation.org
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	Namjae Jeon <linkinjeon@gmail.com>,
	Amit Sahrawat <amit.sahrawat83@gmail.com>
Subject: [PATCH 3/3] fat: warn when discard request fails other than EOPNOTSUPP
Date: Sat,  3 Nov 2012 14:27:58 +0900	[thread overview]
Message-ID: <1351920478-3326-1-git-send-email-linkinjeon@gmail.com> (raw)

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

                 reply	other threads:[~2012-11-03  5:27 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1351920478-3326-1-git-send-email-linkinjeon@gmail.com \
    --to=linkinjeon@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=amit.sahrawat83@gmail.com \
    --cc=hirofumi@mail.parknet.co.jp \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).