* [patch] btrfs scrub: handle -ENOMEM from init_ipath()
@ 2011-11-16 8:28 Dan Carpenter
2011-11-16 16:56 ` Jan Schmidt
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2011-11-16 8:28 UTC (permalink / raw)
To: Chris Mason; +Cc: linux-btrfs, kernel-janitors
init_ipath() can return an ERR_PTR(-ENOMEM).
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c
index ed11d38..b72ee47 100644
--- a/fs/btrfs/scrub.c
+++ b/fs/btrfs/scrub.c
@@ -256,6 +256,11 @@ static int scrub_print_warning_inode(u64 inum, u64 offset, u64 root, void *ctx)
btrfs_release_path(swarn->path);
ipath = init_ipath(4096, local_root, swarn->path);
+ if (IS_ERR(ipath)) {
+ ret = PTR_ERR(ipath);
+ ipath = NULL;
+ goto err;
+ }
ret = paths_from_inode(inum, ipath);
if (ret < 0)
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [patch] btrfs scrub: handle -ENOMEM from init_ipath()
2011-11-16 8:28 [patch] btrfs scrub: handle -ENOMEM from init_ipath() Dan Carpenter
@ 2011-11-16 16:56 ` Jan Schmidt
0 siblings, 0 replies; 2+ messages in thread
From: Jan Schmidt @ 2011-11-16 16:56 UTC (permalink / raw)
To: Dan Carpenter; +Cc: linux-btrfs, Chris Mason, kernel-janitors
On 16.11.2011 09:28, Dan Carpenter wrote:
> init_ipath() can return an ERR_PTR(-ENOMEM).
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net>
Thanks,
-Jan
> diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c
> index ed11d38..b72ee47 100644
> --- a/fs/btrfs/scrub.c
> +++ b/fs/btrfs/scrub.c
> @@ -256,6 +256,11 @@ static int scrub_print_warning_inode(u64 inum, u64 offset, u64 root, void *ctx)
> btrfs_release_path(swarn->path);
>
> ipath = init_ipath(4096, local_root, swarn->path);
> + if (IS_ERR(ipath)) {
> + ret = PTR_ERR(ipath);
> + ipath = NULL;
> + goto err;
> + }
> ret = paths_from_inode(inum, ipath);
>
> if (ret < 0)
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-11-16 16:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-16 8:28 [patch] btrfs scrub: handle -ENOMEM from init_ipath() Dan Carpenter
2011-11-16 16:56 ` Jan Schmidt
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).