From: Jaegeuk Kim <jaegeuk.kim@samsung.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: linux-f2fs-devel@lists.sourceforge.net, kernel-janitors@vger.kernel.org
Subject: Re: [patch] f2fs: alloc_page() doesn't return an ERR_PTR
Date: Wed, 14 Aug 2013 22:24:36 +0900 [thread overview]
Message-ID: <1376486676.2354.5.camel@kjgkr> (raw)
In-Reply-To: <20130814114136.GA8044@elgon.mountain>
Hi Dan,
Agreed.
Could you make a patch that covers other alloc_page cases too?
# grep alloc_page fs/f2fs/*
fs/f2fs/node.c: page = alloc_page(GFP_NOFS | __GFP_ZERO);
fs/f2fs/recovery.c: page = alloc_page(GFP_F2FS_ZERO);
fs/f2fs/recovery.c: page = alloc_page(GFP_NOFS | __GFP_ZERO);
Thank you,
2013-08-14 (수), 14:41 +0300, Dan Carpenter:
> alloc_page() returns a NULL on failure, it never returns an ERR_PTR.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
> index f5172e2..3e87fe0 100644
> --- a/fs/f2fs/node.c
> +++ b/fs/f2fs/node.c
> @@ -1515,8 +1515,8 @@ int restore_node_summary(struct f2fs_sb_info *sbi,
>
> /* alloc temporal page for read node */
> page = alloc_page(GFP_NOFS | __GFP_ZERO);
> - if (IS_ERR(page))
> - return PTR_ERR(page);
> + if (!page)
> + return -ENOMEM;
> lock_page(page);
>
> /* scan the node segment */
--
Jaegeuk Kim
Samsung
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2013-08-14 13:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-14 11:41 [patch] f2fs: alloc_page() doesn't return an ERR_PTR Dan Carpenter
2013-08-14 13:24 ` Jaegeuk Kim [this message]
2013-08-14 13:56 ` Dan Carpenter
2013-08-15 5:54 ` [patch v2] " Dan Carpenter
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=1376486676.2354.5.camel@kjgkr \
--to=jaegeuk.kim@samsung.com \
--cc=dan.carpenter@oracle.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
/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).