Re: [PATCH 02/10] btrfs-progs: save error number correctly in check_chunks_and_extents

2015-10-21 Thread David Sterba
On Tue, Oct 20, 2015 at 06:28:00PM +0800, Eryu Guan wrote:
> On Mon, Oct 19, 2015 at 03:41:04PM +0200, David Sterba wrote:
> > On Mon, Oct 19, 2015 at 07:37:52PM +0800, Eryu Guan wrote:
> > > Coverity reports assigning value from "err" to "ret", but that stored
> > > value is overwritten by check_extent_refs() before it can be used.
> > 
> > If you fix a coverity issue, please add a tag and the id, like
> > 
> > Resolves-coverity-id: 1234
> 
> I was looking hard for CID but without luck.. I will ask around and see
> where I can find the CIDs.

Ok never mind then, I'll pick the patch as-is.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 02/10] btrfs-progs: save error number correctly in check_chunks_and_extents

2015-10-20 Thread Eryu Guan
On Mon, Oct 19, 2015 at 03:41:04PM +0200, David Sterba wrote:
> On Mon, Oct 19, 2015 at 07:37:52PM +0800, Eryu Guan wrote:
> > Coverity reports assigning value from "err" to "ret", but that stored
> > value is overwritten by check_extent_refs() before it can be used.
> 
> If you fix a coverity issue, please add a tag and the id, like
> 
> Resolves-coverity-id: 1234

I was looking hard for CID but without luck.. I will ask around and see
where I can find the CIDs.

Thanks,
Eryu
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 02/10] btrfs-progs: save error number correctly in check_chunks_and_extents

2015-10-19 Thread Eryu Guan
Coverity reports assigning value from "err" to "ret", but that stored
value is overwritten by check_extent_refs() before it can be used.

Signed-off-by: Eryu Guan 
---
 cmds-check.c | 13 ++---
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/cmds-check.c b/cmds-check.c
index 4225b21..80a7c29 100644
--- a/cmds-check.c
+++ b/cmds-check.c
@@ -8066,13 +8066,12 @@ again:
goto out;
}
 
-   err = check_chunks(_cache, _group_cache,
+   ret = check_chunks(_cache, _group_cache,
   _extent_cache, NULL, NULL, NULL, 0);
-   if (err) {
-   if (err == -EAGAIN)
+   if (ret) {
+   if (ret == -EAGAIN)
goto loop;
-   if (!ret)
-   ret = err;
+   err = ret;
}
 
ret = check_extent_refs(root, _cache);
@@ -8082,8 +8081,8 @@ again:
goto out;
}
 
-   err = check_devices(_cache, _extent_cache);
-   if (err && !ret)
+   ret = check_devices(_cache, _extent_cache);
+   if (ret && err)
ret = err;
 
 out:
-- 
2.4.3

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 02/10] btrfs-progs: save error number correctly in check_chunks_and_extents

2015-10-19 Thread David Sterba
On Mon, Oct 19, 2015 at 07:37:52PM +0800, Eryu Guan wrote:
> Coverity reports assigning value from "err" to "ret", but that stored
> value is overwritten by check_extent_refs() before it can be used.

If you fix a coverity issue, please add a tag and the id, like

Resolves-coverity-id: 1234
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html