[RFC v14][PATCH 53/54] Detect resource leaks for whole-container checkpoint

Dave Hansen dave at linux.vnet.ibm.com
Fri May 1 10:26:49 PDT 2009


On Tue, 2009-04-28 at 19:24 -0400, Oren Laadan wrote:
>  /*
>   * helper grab/drop functions:
> - *   obj_no_{drop,grab}: for objects ignored/skipped
> - *   obj_file_{drop,grab}: for file objects
> - *   obj_inode_{drop,grab}: for inode objects
> - *   obj_mm_{drop,grab}: for mm_struct objects
> - *   obj_ns_{drop,grab}: for nsproxy objects
> - *   obj_uts_ns_{drop,grab}: for uts_namespace objects
> - *   obj_ipc_ns_{drop,grab}: for ipc_namespace objects
> + *   obj_no_{drop,grab,users}: for objects ignored/skipped
> + *   obj_file_{drop,grab,users}: for file objects
> + *   obj_inode_{drop,grab,users}: for inode objects
> + *   obj_mm_{drop,grab,users}: for mm_struct objects
> + *   obj_ns_{drop,grab,users}: for nsproxy objects
> + *   obj_uts_ns_{drop,grab,users}: for uts_namespace objects
> + *   obj_ipc_ns_{drop,grab,users}: for ipc_namespace objects
>   */

I think some of this stuff is over-commented.  This is a perfect
example.  It doesn't buy us *anything* except for comments that get
easily stale.  These are away from the function declarations and they
won't even show up in greps or cscope searches for the functions.  If
anyone reads this:

+static void obj_file_drop(void *ptr)
+{
+       fput((struct file *) ptr);
+}

and can't tell that this is 'for file objects' well...  maybe they
should consider a new career in politics or something.

-- Dave



More information about the Containers mailing list