public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v2] Fixes the load command return code under btrfs
@ 2018-09-26 15:01 Stephane Gilbert
  2018-10-01 14:51 ` [U-Boot] [U-Boot, " Tom Rini
  0 siblings, 1 reply; 2+ messages in thread
From: Stephane Gilbert @ 2018-09-26 15:01 UTC (permalink / raw)
  To: u-boot

On Tue, 2018-09-25 at 21:51 -0400, Tom Rini wrote:
>
> Your patch itself seems to have been garbled, please resubmit as v2,
> thanks!

Here is the resubmission!

---
 fs/btrfs/btrfs.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/btrfs/btrfs.c b/fs/btrfs/btrfs.c
index 6f35854823..64ec1af5a9 100644
--- a/fs/btrfs/btrfs.c
+++ b/fs/btrfs/btrfs.c
@@ -183,12 +183,12 @@ int btrfs_read(const char *file, void *buf, loff_t offset, loff_t len,

    if (inr == -1ULL) {
        printf("Cannot lookup file %s\n", file);
-       return 1;
+       return -2;
    }

    if (type != BTRFS_FT_REG_FILE) {
        printf("Not a regular file: %s\n", file);
-       return 1;
+       return -2;
    }

    if (!len)
@@ -200,7 +200,7 @@ int btrfs_read(const char *file, void *buf, loff_t offset, loff_t len,
    rd = btrfs_file_read(&root, inr, offset, len, buf);
    if (rd == -1ULL) {
        printf("An error occured while reading file %s\n", file);
-       return 1;
+       return -5;
    }

    *actread = rd;
-- 
2.14.4

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

* [U-Boot] [U-Boot, v2] Fixes the load command return code under btrfs
  2018-09-26 15:01 [U-Boot] [PATCH v2] Fixes the load command return code under btrfs Stephane Gilbert
@ 2018-10-01 14:51 ` Tom Rini
  0 siblings, 0 replies; 2+ messages in thread
From: Tom Rini @ 2018-10-01 14:51 UTC (permalink / raw)
  To: u-boot

On Wed, Sep 26, 2018 at 03:01:17PM +0000, Stephane Gilbert wrote:

> On Tue, 2018-09-25 at 21:51 -0400, Tom Rini wrote:
> >
> > Your patch itself seems to have been garbled, please resubmit as v2,
> > thanks!
> 
> Here is the resubmission!

OK, sorry, I need a v3.  First, we need a Signed-off-by line.  Second,
please use git send-email to post patches as the whitespace was broken
still.  Finally, please make sure that your commit message (when you do
for example git show) explains the problem and the fix.  In your v1 you
had:
When using the load command with a btrfs filesystem, the return code of
that command if always success even if the command failed. The problem
is the do_load command in fs.c who assume any positive return code from
fs_read as success. However the brtfs read function returns positive
error code in case of failure. Other fs read fonction like fat and ext4
returns negative error codes on failure. So this patch change the
return code of the btrfs read function to be consistent with other read
functions. This way it will be possible to use the return code in the
Hush shell with btrfs file systems as with other filesystems.

And aside from the typo of fonction rather than function, would make a
good message.  I'd have fixed this myself but then I noticed the missing
Signed off by line.  Thanks again!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181001/f81c9acc/attachment.sig>

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

end of thread, other threads:[~2018-10-01 14:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-26 15:01 [U-Boot] [PATCH v2] Fixes the load command return code under btrfs Stephane Gilbert
2018-10-01 14:51 ` [U-Boot] [U-Boot, " Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox