[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210331062723.2090-1-wangfangpeng1@huawei.com>
Date: Wed, 31 Mar 2021 14:27:23 +0800
From: wangfangpeng <wangfangpeng1@...wei.com>
To: <richard@....at>, <ext-adrian.hunter@...ia.com>,
<Artem.Bityutskiy@...ia.com>, <linux-mtd@...ts.infradead.org>,
<linux-kernel@...r.kernel.org>
CC: <nixiaoming@...wei.com>, <zengweilin@...wei.com>,
<stable@...r.kernel.org>
Subject: [PATCH] ubifs: fix read fail but return ok
do_readpage() may return err, but ubifs_readpage() always return ok.
The vfs will ignore the err happen in ubifs.
Fixes: 1e51764a3c2ac05a2 ("UBIFS: add new flash file system")
Cc: <stable@...r.kernel.org> #v2.6.27
Signed-off-by: wangfangpeng <wangfangpeng1@...wei.com>
---
fs/ubifs/file.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/fs/ubifs/file.c b/fs/ubifs/file.c
index 0e4b4be3aa26..001feec1d415 100644
--- a/fs/ubifs/file.c
+++ b/fs/ubifs/file.c
@@ -892,11 +892,13 @@ static int ubifs_bulk_read(struct page *page)
static int ubifs_readpage(struct file *file, struct page *page)
{
+ int ret;
+
if (ubifs_bulk_read(page))
return 0;
- do_readpage(page);
+ ret = do_readpage(page);
unlock_page(page);
- return 0;
+ return ret;
}
static int do_writepage(struct page *page, int len)
--
2.12.3
Powered by blists - more mailing lists