mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH] fixup! usb: gadget: fastboot: call discard_range for sparse files as well
Date: Fri, 28 Feb 2020 10:58:18 +0100	[thread overview]
Message-ID: <20200228095817.13332-1-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20200227165825.1624-2-a.fatoum@pengutronix.de>

I've not tested it with ubi formatted partitions and if we want it
there, it's more effecient to do it once in the ubi_format probably.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 drivers/usb/gadget/f_fastboot.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_fastboot.c
index 99c6a5c0cb83..96aecacc27e5 100644
--- a/drivers/usb/gadget/f_fastboot.c
+++ b/drivers/usb/gadget/f_fastboot.c
@@ -941,8 +941,6 @@ static int fastboot_handle_sparse(struct f_fastboot *f_fb,
 				goto out;
 		}
 
-		discard_range(fd, retlen, pos);
-
 		if (fentry->flags & FILE_LIST_FLAG_UBI) {
 			if (!IS_ENABLED(CONFIG_UBIFORMAT)) {
 				ret = -ENOSYS;
@@ -959,6 +957,8 @@ static int fastboot_handle_sparse(struct f_fastboot *f_fb,
 			if (ret)
 				goto out;
 		} else {
+			discard_range(fd, retlen, pos);
+
 			pos = lseek(fd, pos, SEEK_SET);
 			if (pos == -1) {
 				ret = -errno;
-- 
2.25.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2020-02-28  9:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-27 16:58 [PATCH 0/2] USB fastboot onto eMMC: make 30% faster! Ahmad Fatoum
2020-02-27 16:58 ` [PATCH 1/2] usb: gadget: fastboot: call discard_range for sparse files as well Ahmad Fatoum
2020-02-28  9:58   ` Ahmad Fatoum [this message]
2020-02-27 16:58 ` [PATCH 2/2] Revert "block: Adjust cache sizes" Ahmad Fatoum
2020-03-02  8:15 ` [PATCH 0/2] USB fastboot onto eMMC: make 30% faster! Sascha Hauer

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=20200228095817.13332-1-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.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