On Mon, Aug 2, 2010 at 12:39 PM, Murlin Wenzel <[email protected]> wrote:
> This patch will allow swapon03 test case to pass even when max_swapfiles is 
> not known.  Create maximum possible number of swapfiles during setup, then 
> verify that attempting to create one more swapfile will return EPERM.  This 
> is meant to change as little as possible of the existing code.
>
> Signed-off-by: Murlin Ray Wenzel [email protected]

ACK.

This seems like a decent compromise because the point where this could
fail is after the first iteration and we already check for root, which
means that the first clause (CAP_SYS_ADMIN) of EPERM is caught:

EPERM
    The caller does not have the CAP_SYS_ADMIN capability or the
maximal number of swap files has been reached. (The maximum is
MAX_SWAPFILES-2(30) if CONFIG_MIGRATION is enabled, MAX_SWAPFILES (32)
otherwise. In Linux kernel versions prior to 2.4.10, the maximum was
always MAX_SWAPFILES, which was 8.

Thanks!
-Garrett

------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to