From: Dan Carpenter <error27@gmail.com>
To: Joseph Qi <joseph.qi@linux.alibaba.com>
Cc: oe-kbuild@lists.linux.dev,
Heming Zhao via Ocfs2-devel <ocfs2-devel@oss.oracle.com>,
lkp@intel.com, oe-kbuild-all@lists.linux.dev,
linux-kernel@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>,
Linux Memory Management List <linux-mm@kvack.org>
Subject: Re: fs/ocfs2/super.c:1809 ocfs2_mount_volume() warn: missing error code 'status'
Date: Mon, 7 Nov 2022 10:52:55 +0300 [thread overview]
Message-ID: <Y2i5V0CIH2tOCMUs@kadam> (raw)
In-Reply-To: <97361840-0a56-f074-0495-712dafe4313d@linux.alibaba.com>
On Sun, Nov 06, 2022 at 08:38:07PM +0800, Joseph Qi wrote:
>
>
> On 11/5/22 7:15 PM, Dan Carpenter wrote:
> > tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> > head: 10d916c86ecafeccaed89175ebf9b832dddde380
> > commit: 0737e01de9c411e4db87dcedf4a9789d41b1c5c1 ocfs2: ocfs2_mount_volume does cleanup job before return error
> > config: alpha-randconfig-m041-20221030
> > compiler: alpha-linux-gcc (GCC) 12.1.0
> >
> > If you fix the issue, kindly add following tag where applicable
> > | Reported-by: kernel test robot <lkp@intel.com>
> > | Reported-by: Dan Carpenter <error27@gmail.com>
> >
> > smatch warnings:
> > fs/ocfs2/super.c:1809 ocfs2_mount_volume() warn: missing error code 'status'
> >
> > vim +/status +1809 fs/ocfs2/super.c
> >
> > ccd979bdbce9fba Mark Fasheh 2005-12-15 1802
> > ccd979bdbce9fba Mark Fasheh 2005-12-15 1803 static int ocfs2_mount_volume(struct super_block *sb)
> > ccd979bdbce9fba Mark Fasheh 2005-12-15 1804 {
> > ccd979bdbce9fba Mark Fasheh 2005-12-15 1805 int status = 0;
> > ccd979bdbce9fba Mark Fasheh 2005-12-15 1806 struct ocfs2_super *osb = OCFS2_SB(sb);
> > ccd979bdbce9fba Mark Fasheh 2005-12-15 1807
> > ccd979bdbce9fba Mark Fasheh 2005-12-15 1808 if (ocfs2_is_hard_readonly(osb))
> > 0737e01de9c411e Heming Zhao via Ocfs2-devel 2022-04-29 @1809 goto out;
> >
> > Unclear if this is an error path or a success path. Honestly, I would
> > have thought the checker is correct that it looks like a failure path.
> >
> This indicates a readonly mount and bypasses dlm related initialization.
> So it seems an expected success return.
>
A comment would help. Another way to silence this static checker warning
and answer any reviewer questions would be to set the "ret = 0;" within
4 lines of the goto.
if (ocfs2_is_hard_readonly(osb)) {
status = 0;
goto out;
}
regards,
dan carpenter
prev parent reply other threads:[~2022-11-07 7:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-05 11:15 fs/ocfs2/super.c:1809 ocfs2_mount_volume() warn: missing error code 'status' Dan Carpenter
2022-11-06 12:38 ` Joseph Qi
2022-11-07 7:52 ` Dan Carpenter [this message]
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=Y2i5V0CIH2tOCMUs@kadam \
--to=error27@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=joseph.qi@linux.alibaba.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lkp@intel.com \
--cc=ocfs2-devel@oss.oracle.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=oe-kbuild@lists.linux.dev \
/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;
as well as URLs for NNTP newsgroup(s).