From: minwoo.im.dev@gmail.com (Minwoo Im) Date: Mon, 10 Jun 2019 18:17:55 +0900 Subject: [PATCH V6 6/6] fabrics: Return errno mapped for fabrics error status In-Reply-To: References: <20190604154034.23386-1-minwoo.im.dev@gmail.com> <20190604154034.23386-7-minwoo.im.dev@gmail.com> <20190608200112.GC28228@minwoo-900X5N> Message-ID: <20190610091755.GA1879@minwooim-desktop> On 19-06-08 20:13:00, Chaitanya Kulkarni wrote: > (+ CC: Sagi). > > I'm fine if Sagi is okay with this. Sagi, Could you please have a look into this seriesfor the fabrics changes? Thanks, > > On 06/08/2019 01:01 PM, Minwoo Im wrote: > > On 19-06-08 19:36:42, Chaitanya Kulkarni wrote: > >>> @@ -874,9 +877,11 @@ static int do_discover(char *argstr, bool connect) > >>> case DISC_GET_NUMRECS: > >>> fprintf(stderr, > >>> "Get number of discovery log entries failed.\n"); > >>> + ret = status; > >>> break; > >>> case DISC_GET_LOG: > >>> fprintf(stderr, "Get discovery log entries failed.\n"); > >>> + ret = status; > >>> break; > >>> case DISC_NO_LOG: > >>> fprintf(stdout, "No discovery log entries to fetch.\n"); > >>> @@ -885,6 +890,7 @@ static int do_discover(char *argstr, bool connect) > >>> case DISC_NOT_EQUAL: > >>> fprintf(stderr, > >>> "Numrec values of last two get discovery log page not equal\n"); > >>> + ret = DISC_OK; > >> Can you please explain above assignment ? > > > > Even it fails due to a mismatch between numrec in the header and the > > actual nr_entries, the discovery log-page has been done successfully > > whose status code should be in zero. > > > > That code is just returning 0 to the caller which does not need to fail > > due to this reason. You may ask me why I didn't do like: > > ret = 0; > > > > That is just following the code right above which is a case for > > DISC_NO_LOG. > > > > What do you think about it ? > > > > Thanks! > > >