* [patch] block-dev: checking for NULL instead of IS_ERR()
@ 2016-03-08 12:05 Dan Carpenter
2016-03-15 7:26 ` Christoph Hellwig
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2016-03-08 12:05 UTC (permalink / raw)
To: Alexander Viro, Shaohua Li; +Cc: linux-fsdevel, linux-kernel, kernel-janitors
This should be an IS_ERR() check. mount_pseudo() returns error pointers
and this function should return the error pointer to its caller as well.
Fixes: 3684aa7099e0 ('block-dev: enable writeback cgroup support')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/fs/block_dev.c b/fs/block_dev.c
index 3172c4e..2de969e 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -577,7 +577,7 @@ static struct dentry *bd_mount(struct file_system_type *fs_type,
{
struct dentry *dent;
dent = mount_pseudo(fs_type, "bdev:", &bdev_sops, NULL, BDEVFS_MAGIC);
- if (dent)
+ if (!IS_ERR(dent))
dent->d_sb->s_iflags |= SB_I_CGROUPWB;
return dent;
}
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [patch] block-dev: checking for NULL instead of IS_ERR()
2016-03-08 12:05 [patch] block-dev: checking for NULL instead of IS_ERR() Dan Carpenter
@ 2016-03-15 7:26 ` Christoph Hellwig
0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2016-03-15 7:26 UTC (permalink / raw)
To: Dan Carpenter
Cc: Alexander Viro, Shaohua Li, linux-fsdevel, linux-kernel,
kernel-janitors
On Tue, Mar 08, 2016 at 03:05:46PM +0300, Dan Carpenter wrote:
> This should be an IS_ERR() check. mount_pseudo() returns error pointers
> and this function should return the error pointer to its caller as well.
>
> Fixes: 3684aa7099e0 ('block-dev: enable writeback cgroup support')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Looks fine. Would be much nicer to simply pass possible flags as an
argument to mount_pseudo to avoid this whole dance..
Reviewed-by: Christoph Hellwig <hch@lst.de>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-03-15 7:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-08 12:05 [patch] block-dev: checking for NULL instead of IS_ERR() Dan Carpenter
2016-03-15 7:26 ` Christoph Hellwig
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).