On Mon, Dec 16, 2013 at 6:07 PM, Sage Weil <s...@inktank.com> wrote:
>
>
> ---------- Forwarded message ----------
> From: scan-ad...@coverity.com
> To: undisclosed-recipients:;
> Cc:
> Date: Mon, 16 Dec 2013 00:57:57 -0800
> Subject: New Defects reported by Coverity Scan for ceph
>
>
> Hi,
>
>
> Please find the latest report on new defect(s) introduced to ceph found with 
> Coverity Scan.
>
> Defect(s) Reported-by: Coverity Scan
> Showing 4 of 4 defect(s)
>
>
> ** CID 1138366:  Resource leak  (RESOURCE_LEAK)
> /test/librados/tier.cc: 96 in LibRadosMisc_HitSetNone_Test::TestBody()()
> /test/librados/tier.cc: 98 in LibRadosMisc_HitSetNone_Test::TestBody()()
> /test/librados/tier.cc: 99 in LibRadosMisc_HitSetNone_Test::TestBody()()
>
> ** CID 1138367:  Time of check time of use  (TOCTOU)
> /rbd.cc: 2024 in do_kernel_rm(const char *)()
>
> ** CID 1138368:  Time of check time of use  (TOCTOU)
> /rbd.cc: 1735 in do_kernel_add(const char *, const char *, const char *)()

Look like these two refer to my recent work on rbd:

2019   const char *fname = "/sys/bus/rbd/remove_single_major";
2020   if (stat(fname, &sbuf)) {
2021     fname = "/sys/bus/rbd/remove";
2022   }
2023
2024   int fd = open(fname, O_WRONLY); <---
2025   if (fd < 0) {

This is not a TOCTOU as there is no race here, so technically
annotations are in order, but I'll redo it as two open()s instead.

Thanks,

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

Reply via email to