OCFS2: remove useless err
PATCH 1/1 OCFS2: remove useless err
We don't need 'err' in these 2 places, better to remove them.
--- fs/ocfs2/cluster/tcp.c | 3 +-- fs/ocfs2/dir.c | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-)
fs/ocfs2/cluster/tcp.c +1 -2
@@ -1948,7 +1948,6 @@ static void o2net_accept_many(struct work_struct *work) {struct socket *sock = o2net_listen_sock;int more; -int err;/* * It is critical to note that due to interrupt moderation
@@ -1963,7 +1962,7 @@ static void o2net_accept_many(struct work_struct *work)*/ for (;;) { - err =o2net_accept_one (sock, &more); +o2net_accept_one (sock, &more);if (!more)break ;cond_resched ();
fs/ocfs2/dir.c +2 -2
@@ -676,7 +676,7 @@ static struct buffer_head *ocfs2_find_entry_el(const char *name, int namelen,int ra_ptr =0 ;/* Current index into readahead buffer */ int num =0 ; -int nblocks, i, err; +int nblocks, i; sb = dir->i_sb;
@@ -708,7 +708,7 @@ static struct buffer_head *ocfs2_find_entry_el(const char *name, int namelen, num++; bh =NULL ; - err =ocfs2_read_dir_block (dir, b++, &bh, +ocfs2_read_dir_block (dir, b++, &bh,OCFS2_BH_READAHEAD ); bh_use[ra_max] = bh; }
Signature · 1 line
1.8.3.1
Joseph Qi
maintainerQuoted 54 lines · Alex Shi
We don't need 'err' in these 2 places, better to remove them.
Signed-off-by Alex Shi <[email protected]>Cc Mark Fasheh <[email protected]>Cc Joel Becker <[email protected]>Cc Joseph Qi <[email protected]>Cc Andrew Morton <[email protected]>Cc Greg Kroah-Hartman <[email protected]>Cc Kate Stewart <[email protected]>Cc ChenGang <[email protected]>Cc Richard Fontana <[email protected]>Cc Thomas Gleixner <[email protected]>Cc ocfs2-devel at oss.oracle.comCc linux-kernel at vger.kernel.org--- fs/ocfs2/cluster/tcp.c | 3 +-- fs/ocfs2/dir.c | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-)fs/ocfs2/cluster/tcp.c +1
-2@@ -1948,7 +1948,6 @@ static void o2net_accept_many(struct work_struct *work) {struct socket *sock = o2net_listen_sock;int more; -int err;/* * It is critical to note that due to interrupt moderation @@ -1963,7 +1962,7 @@ static void o2net_accept_many(struct work_struct *work)*/ for (;;) { - err =o2net_accept_one (sock, &more); +o2net_accept_one (sock, &more);if (!more)break ;cond_resched ();fs/ocfs2/dir.c +1
-1@@ -676,7 +676,7 @@ static struct buffer_head *ocfs2_find_entry_el(const char *name, int namelen,int ra_ptr =0 ;/* Current index into readahead buffer */ int num =0 ; -int nblocks, i, err; +int nblocks, i; sb = dir->i_sb;
fs/ocfs2/dir.c static struct buffer_head *ocfs2_find_entry_el(const char *name, int namelen, · line 712
Quoted 6 lines
fs/ocfs2/dir.c +1
-1@@ -708,7 +708,7 @@ static struct buffer_head *ocfs2_find_entry_el(const char *name, int namelen, num++; bh =NULL ; - err =ocfs2_read_dir_block (dir, b++, &bh, +ocfs2_read_dir_block (dir, b++, &bh,OCFS2_BH_READAHEAD );
Umm... missing error checking here?
Thanks,
Joseph
Quoted 3 lines
fs/ocfs2/dir.c +0
-0bh_use[ra_max] = bh; }
Quoted 6 lines · Joseph Qi
Quoted 6 lines
(quoted diff) +0
-0@@ -708,7 +708,7 @@ static struct buffer_head *ocfs2_find_entry_el(const char *name, int namelen, num++;
Quoted 6 lines
fs/ocfs2/dir.c static struct buffer_head *ocfs2_find_entry_el(const char *name, int namelen, · line 712
Quoted 4 lines
fs/ocfs2/dir.c +1
-1bh =NULL ; - err =ocfs2_read_dir_block (dir, b++, &bh, +ocfs2_read_dir_block (dir, b++, &bh,OCFS2_BH_READAHEAD );Umm... missing error checking here?
/*
* This function forces all errors to -EIO for consistency with its
* predecessor, ocfs2_bread(). We haven't audited what returning the
* real error codes would do to callers. We log the real codes with
* mlog_errno() before we squash them.
*/
static int ocfs2_read_dir_block(struct inode *inode, u64 v_block,
struct buffer_head **bh, int flags)
According to ocfs2_read_dir_block comments, caller don't care the err value, func will log it.
So is this patch ok? :)
Thanks
Alex
Joseph Qi
maintainerQuoted 26 lines · Alex Shi
? 2020/1/26 ??9:52, Joseph Qi ??:
Quoted 6 lines
Quoted 6 lines
(quoted diff) +0
-0@@ -708,7 +708,7 @@ static struct buffer_head *ocfs2_find_entry_el(const char *name, int namelen, num++;Quoted 6 lines
fs/ocfs2/dir.c static struct buffer_head *ocfs2_find_entry_el(const char *name, int namelen, · line 712
Quoted 4 lines
fs/ocfs2/dir.c +1
-1bh =NULL ; - err =ocfs2_read_dir_block (dir, b++, &bh, +ocfs2_read_dir_block (dir, b++, &bh,OCFS2_BH_READAHEAD );Umm... missing error checking here?
/*
* This function forces all errors to-EIOfor consistency with its
* predecessor,ocfs2_bread(). We haven't audited what returning the
* real error codes would do to callers. We log the real codes with
*mlog_errno()before we squash them.
*/
static int ocfs2_read_dir_block(struct inode *inode, u64v_block,
structbuffer_head**bh, int flags)
Quoted 4 lines
According to
ocfs2_read_dir_blockcomments, caller don't care the err value, func will log it.So is this patch ok? :)
If we got error here, it means the buffer head is invalid. So how about mark it as NULL and skip it?
Thanks,
Joseph
Joseph Qi
maintainerQuoted 29 lines · Joseph Qi
Quoted 26 lines · Alex Shi
? 2020/1/26 ??9:52, Joseph Qi ??:
Quoted 6 lines
Quoted 6 lines
(quoted diff) +0
-0@@ -708,7 +708,7 @@ static struct buffer_head *ocfs2_find_entry_el(const char *name, int namelen, num++;Quoted 6 lines
fs/ocfs2/dir.c static struct buffer_head *ocfs2_find_entry_el(const char *name, int namelen, · line 712
Quoted 4 lines
fs/ocfs2/dir.c +1
-1bh =NULL ; - err =ocfs2_read_dir_block (dir, b++, &bh, +ocfs2_read_dir_block (dir, b++, &bh,OCFS2_BH_READAHEAD );Umm... missing error checking here?
/*
* This function forces all errors to-EIOfor consistency with its
* predecessor,ocfs2_bread(). We haven't audited what returning the
* real error codes would do to callers. We log the real codes with
*mlog_errno()before we squash them.
*/
static int ocfs2_read_dir_block(struct inode *inode, u64v_block,
structbuffer_head**bh, int flags)
Quoted 7 lines
Quoted 4 lines
According to
ocfs2_read_dir_blockcomments, caller don't care the err value, func will log it.So is this patch ok? :)
If we got error here, it means the buffer head is invalid. So how about mark it as NULL and skip it?
Okay, in this case, bh is already NULL and will skip below, so it looks fine to me.
Quoted 14 lines · Alex Shi
We don't need 'err' in these 2 places, better to remove them.
Signed-off-by Alex Shi <[email protected]>Cc Mark Fasheh <[email protected]>Cc Joel Becker <[email protected]>Cc Joseph Qi <[email protected]>Cc Andrew Morton <[email protected]>Cc Greg Kroah-Hartman <[email protected]>Cc Kate Stewart <[email protected]>Cc ChenGang <[email protected]>Cc Richard Fontana <[email protected]>Cc Thomas Gleixner <[email protected]>Cc ocfs2-devel at oss.oracle.comCc linux-kernel at vger.kernel.org
Quoted 49 lines
--- fs/ocfs2/cluster/tcp.c | 3 +-- fs/ocfs2/dir.c | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-)fs/ocfs2/cluster/tcp.c +1
-2@@ -1948,7 +1948,6 @@ static void o2net_accept_many(struct work_struct *work) {struct socket *sock = o2net_listen_sock;int more; -int err;/* * It is critical to note that due to interrupt moderation @@ -1963,7 +1962,7 @@ static void o2net_accept_many(struct work_struct *work)*/ for (;;) { - err =o2net_accept_one (sock, &more); +o2net_accept_one (sock, &more);if (!more)break ;cond_resched ();fs/ocfs2/dir.c +2
-2@@ -676,7 +676,7 @@ static struct buffer_head *ocfs2_find_entry_el(const char *name, int namelen,int ra_ptr =0 ;/* Current index into readahead buffer */ int num =0 ; -int nblocks, i, err; +int nblocks, i; sb = dir->i_sb;@@ -708,7 +708,7 @@ static struct buffer_head *ocfs2_find_entry_el(const char *name, int namelen, num++; bh =NULL ; - err =ocfs2_read_dir_block (dir, b++, &bh, +ocfs2_read_dir_block (dir, b++, &bh,OCFS2_BH_READAHEAD ); bh_use[ra_max] = bh; }