From: Nick Krause <xerofoify@gmail.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: akpm@linux-foundation.org, viro@zeniv.linux.org.uk,
fabf@skynet.be, kirill.shutemov@linux.intel.com,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Check for Null return of function of affs_bread in function affs_truncate
Date: Fri, 20 Jun 2014 12:30:42 -0400 [thread overview]
Message-ID: <CAPDOMVgwT2=iWAHOhgHSBY1B+KoWHQgCdK4idD2miwB=_eMs5Q@mail.gmail.com> (raw)
In-Reply-To: <20140619052128.GV5015@mwanda>
Ok that's fine I would return as if it's a NULL the other parts of the
function can't continue.
Nick
On Thu, Jun 19, 2014 at 1:21 AM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> On Wed, Jun 18, 2014 at 06:08:05PM -0400, Nicholas Krause wrote:
>> Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
>> ---
>> fs/affs/file.c | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>> diff --git a/fs/affs/file.c b/fs/affs/file.c
>> index a7fe57d..f26482d 100644
>> --- a/fs/affs/file.c
>> +++ b/fs/affs/file.c
>> @@ -923,6 +923,8 @@ affs_truncate(struct inode *inode)
>>
>> while (ext_key) {
>> ext_bh = affs_bread(sb, ext_key);
>> + if (!ext_bh)
>> + return;
>
> The problem is that we don't know if we should return here or break
> here. If you don't understand the code, then it's best to just leave it
> alone.
>
> regards,
> dan carpenter
>
>> size = AFFS_SB(sb)->s_hashsize;
>> if (size > blkcnt - blk)
>> size = blkcnt - blk;
>> --
>> 1.9.1
next prev parent reply other threads:[~2014-06-20 16:30 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-18 22:08 [PATCH] Check for Null return of function of affs_bread in function affs_truncate Nicholas Krause
2014-06-19 5:21 ` Dan Carpenter
2014-06-20 16:30 ` Nick Krause [this message]
2014-06-20 23:59 ` Thomas Gleixner
2014-06-21 2:25 ` Nick Krause
2014-06-21 2:38 ` Andrew Morton
2014-06-21 2:55 ` Nick Krause
2014-06-21 3:09 ` Andrew Morton
2014-06-21 3:20 ` Nick Krause
2014-06-22 19:12 ` Al Viro
2014-07-11 15:05 ` Dan Carpenter
2014-07-13 6:18 ` Nick Krause
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='CAPDOMVgwT2=iWAHOhgHSBY1B+KoWHQgCdK4idD2miwB=_eMs5Q@mail.gmail.com' \
--to=xerofoify@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=dan.carpenter@oracle.com \
--cc=fabf@skynet.be \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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).