mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
To: Namjae Jeon <linkinjeon@gmail.com>
Cc: akpm@linux-foundation.org, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Amit Sahrawat <amit.sahrawat83@gmail.com>
Subject: Re: [PATCH v2 3/3] fat: warn when discard request fails other than EOPNOTSUPP
Date: Mon, 05 Nov 2012 19:53:50 +0900	[thread overview]
Message-ID: <87fw4omibl.fsf@devron.myhome.or.jp> (raw)
In-Reply-To: <1351924134-14320-1-git-send-email-linkinjeon@gmail.com> (Namjae Jeon's message of "Sat, 3 Nov 2012 15:28:54 +0900")

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>

  reply	other threads:[~2012-11-05 10:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-03  6:28 Namjae Jeon
2012-11-05 10:53 ` OGAWA Hirofumi [this message]
2012-11-11 11:39   ` Namjae Jeon

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=87fw4omibl.fsf@devron.myhome.or.jp \
    --to=hirofumi@mail.parknet.co.jp \
    --cc=akpm@linux-foundation.org \
    --cc=amit.sahrawat83@gmail.com \
    --cc=linkinjeon@gmail.com \
    --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

all inboxes | Powered by JetHome®