Re: [PATCH 01/26] statd: Replace note() with xlog() in rpc.statd

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

 




On Oct 14, 2009, at 12:57 PM, J. Bruce Fields wrote:

On Tue, Oct 13, 2009 at 10:54:16AM -0400, Chuck Lever wrote:
diff --git a/utils/statd/misc.c b/utils/statd/misc.c
index 7256291..44af30e 100644
--- a/utils/statd/misc.c
+++ b/utils/statd/misc.c
@@ -29,8 +29,7 @@ xmalloc (size_t size)
    return ((void *)NULL);

  if (!(ptr = malloc (size)))
-    /* SHIT!  SHIT!  SHIT! */
-    die ("malloc failed");
+    xlog_err ("malloc failed");

Minor comment, no need to fix now, but: with the name "die" it was a lot
more obvious that this function never returned.

This is going away, eventually.  See below.

Also future work (not a problem with this patch): it's irritating that
we have long-running daemons dying on memory allocation failures.
Wouldn't it be better if they failed just the current operation and
tried to keep going?

Yes. One of the goals of this rework was to replace xmalloc and xstrdup in statd, but I've left that behind in the interest of minimizing scope creep.

--
Chuck Lever
chuck[dot]lever[at]oracle[dot]com



--
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