Re: [patch 0/4] Cleanup file_count usage

From: Paul Mackerras
Date: Wed Nov 17 2004 - 17:15:39 EST


Ravikiran G Thirumalai writes:

> How about this patch? This doesn't leak memory hopefully.
>
> ---
> Patch to cleanup reads to f_count from ppp driver, deprecate PPPIOCDETACH
> ioctl, and print warning messages if the ioctl is used.
>
> A new 'detached' field is included in struct ppp_file, and the ppp
> channel/interface is marked as detached when PPPIOCDETACH is invoked
> instead of checking the f_count and failing the ioctl for 'if the fd was
> dup'd' case. The ppp structure is freed on last close.

The difficulty comes when pppd does a PPPIOCNEWUNIT, a PPPIOCDETACH,
and another PPPIOCNEWUNIT. To test that, you would need to use
ppp-2.4.0 or ppp-2.4.1 and use the persist option to pppd. Make one
connection and then terminate it (unplug the modem, or use the idle
option to pppd). Pppd should then try to reestablish the connection.
The question is whether the second connection attempt succeeds or not.
I think that with your patch it won't (from a quick look).

Paul.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/