Re: [PATCH 12/16] nfs-utils: make makesock() static

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Sep 4, 2008 at 9:14 PM, Neil Brown <neilb@xxxxxxx> wrote:
> On Thursday September 4, chuck.lever@xxxxxxxxxx wrote:
>>
>>  o  Return RPC_ANYSOCK on error (this is -1) instead of open-coding -1.
>
> I don't agree with this change.
>
> Everything else (including the last) looks fine, though I personally
> wouldn't bother closing file descriptors and freeing memory just
> before exit.

If nothing else, it makes interpreting the output of valgrind easier.  :-)

Code in nfs-utils seems to last many many years, and is copied and
pasted a lot without regard to context (ie code that may have been
written for a single-shot application may suddenly find itself
embedded in a long-running daemon).  Considering that parts of
nfs-utils are used in HA environments, I'd rather be safe then sorry.

> RPC_ANYSOCK is an input value to various rpc library functions which
> means "I haven't opened a socket, you do it for me".  It is not really
> a valid return value.

Well, FWIW it is treated as a return value by
utils/mount/network.c:get_socket() and it's callers.

> Every time makesock is called, the return status is tested with
>     if (makesock(...) < 0)
>
> To me, that says that the returned value should be e.g. -1, not
> RPC_ANYSOCK.

OK, I'll drop it.  Thanks for the review.

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

[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux