From: Jan Blunck <j.blunck@tu-harburg.de>
To: linux-kernel@vger.kernel.org
Cc: torvalds@osdl.org, ext2-devel@lists.sourceforge.net
Subject: [PATCH] Fix ext2_readdir()
Date: Mon, 26 Jul 2004 12:20:33 +0200 [thread overview]
Message-ID: <4104DAF1.2090608@tu-harburg.de> (raw)
[-- Attachment #1: Type: text/plain, Size: 145 bytes --]
I noticed that ext2_readdir() is ignoring the set error return values
and always returns 0.
Signed-off-by: Jan Blunck <j.blunck@tu-harburg.de>
[-- Attachment #2: ext2_readdir.diff --]
[-- Type: text/x-patch, Size: 960 bytes --]
Index: testing-2.5/fs/ext2/dir.c
===================================================================
--- testing-2.5.orig/fs/ext2/dir.c 2004-07-24 09:54:50.174994960 +0200
+++ testing-2.5/fs/ext2/dir.c 2004-07-24 10:58:52.430883280 +0200
@@ -257,10 +257,10 @@
unsigned chunk_mask = ~(ext2_chunk_size(inode)-1);
unsigned char *types = NULL;
int need_revalidate = (filp->f_version != inode->i_version);
- int ret = 0;
+ int ret;
if (pos > inode->i_size - EXT2_DIR_REC_LEN(1))
- goto done;
+ goto success;
if (EXT2_HAS_INCOMPAT_FEATURE(sb, EXT2_FEATURE_INCOMPAT_FILETYPE))
types = ext2_filetype_table;
@@ -300,17 +300,19 @@
le32_to_cpu(de->inode), d_type);
if (over) {
ext2_put_page(page);
- goto done;
+ goto success;
}
}
}
ext2_put_page(page);
}
+success:
+ ret = 0;
done:
filp->f_pos = (n << PAGE_CACHE_SHIFT) | offset;
filp->f_version = inode->i_version;
- return 0;
+ return ret;
}
/*
reply other threads:[~2004-07-26 10:21 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=4104DAF1.2090608@tu-harburg.de \
--to=j.blunck@tu-harburg.de \
--cc=ext2-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@osdl.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®