From patchwork Mon Sep 7 09:20:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gary Bisson X-Patchwork-Id: 515130 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 2F60E1401CB for ; Mon, 7 Sep 2015 22:48:23 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 244394B73E; Mon, 7 Sep 2015 14:48:20 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id z28493lB_Bdz; Mon, 7 Sep 2015 14:48:20 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 58D864B716; Mon, 7 Sep 2015 14:48:05 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id F0D054B6EA for ; Mon, 7 Sep 2015 11:20:21 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kRZLpdVjrWka for ; Mon, 7 Sep 2015 11:20:21 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-wi0-f180.google.com (mail-wi0-f180.google.com [209.85.212.180]) by theia.denx.de (Postfix) with ESMTPS id 137574B6F3 for ; Mon, 7 Sep 2015 11:20:14 +0200 (CEST) Received: by wicfx3 with SMTP id fx3so76808581wic.0 for ; Mon, 07 Sep 2015 02:20:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=fM4ZQxrIk9pg3MRpoP4MWfXG8w0nYXJ7K4NcXY5C+G4=; b=c2pFVvXyqx/W1l6SiQAtgmoa38ApMv4irMYqqdeg5eqREMb68CxXo2bkNGI4fQsifM Cpq2py6Di4vgEcmc+j+DErgdD8cbKgCK/TqacPGZC/YAJ8hF1IaqVXjsJ6FNiW7P3xnH l/bTALYib3ncrIJ4Orr/jkWfHAUJGImGaaQNt/SyfvWY9zkI0aHcEwFMszqILnQqZnNj 3+FHPBfILTnttbtUvipoNPH/nmXNsMZ8BY3FgBhNWwMfA/7dizHirdSMdD448fzOI9Uf yru8avq6/8cT6EGlRSdn+ZAOfT6yjAq2pifKsagBvQUevt+/Ar2aHJvXwPTbKpCfuOYb bJNQ== X-Gm-Message-State: ALoCoQm2qJYPQEOTGv1CF1EN21h5r4CdmumXCyMOClYOOTwg6GNhRknHiS8SU40WpOCRIIRtd1hj X-Received: by 10.194.60.115 with SMTP id g19mr14283028wjr.29.1441617613556; Mon, 07 Sep 2015 02:20:13 -0700 (PDT) Received: from t450s.lan (89-92-157-132.hfc.dyn.abo.bbox.fr. [89.92.157.132]) by smtp.googlemail.com with ESMTPSA id ex17sm19233721wid.23.2015.09.07.02.20.12 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 07 Sep 2015 02:20:13 -0700 (PDT) From: Gary Bisson To: u-boot@lists.denx.de Date: Mon, 7 Sep 2015 11:20:07 +0200 Message-Id: <1441617607-25676-1-git-send-email-gary.bisson@boundarydevices.com> X-Mailer: git-send-email 2.5.1 X-Mailman-Approved-At: Mon, 07 Sep 2015 14:47:54 +0200 Cc: Gary Bisson , trini@konsulko.com Subject: [U-Boot] [PATCH] fs: ext4: fix symlink read function X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Since last API changes for files >2GB, the read of symlink is broken as ext4fs_read_file now returns 0 instead of the length of the actual read. Signed-off-by: Gary Bisson --- Hi all, Switching from an old v2014.07 to v2015.07 we've noticed that we couldn't read symlinks any more. This is due to the API changes made to ext4fs_read_file (commit 9f12cd0). This patch makes the read symlink check both for errors (status < 0) and actual read length. Regards, Gary --- fs/ext4/ext4_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ext4/ext4_common.c b/fs/ext4/ext4_common.c index cab5465..e2ab145 100644 --- a/fs/ext4/ext4_common.c +++ b/fs/ext4/ext4_common.c @@ -2040,7 +2040,7 @@ static char *ext4fs_read_symlink(struct ext2fs_node *node) status = ext4fs_read_file(diro, 0, __le32_to_cpu(diro->inode.size), symlink, &actread); - if (status == 0) { + if ((status < 0) || (actread == 0)) { free(symlink); return 0; }