From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pablo Neira Ayuso Subject: Re: Xtables2 Netlink spec Date: Mon, 29 Nov 2010 13:23:36 +0100 Message-ID: <4CF39B48.4090300@netfilter.org> References: <4CEE4B94.8010307@netfilter.org> <4CEE70CE.60502@netfilter.org> <4CEF6F12.7080601@netfilter.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Jozsef Kadlecsik , Netfilter Developer Mailing List To: Jan Engelhardt Return-path: Received: from mail.us.es ([193.147.175.20]:60631 "EHLO mail.us.es" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753839Ab0K2MWz (ORCPT ); Mon, 29 Nov 2010 07:22:55 -0500 In-Reply-To: Sender: netfilter-devel-owner@vger.kernel.org List-ID: On 26/11/10 20:55, Jan Engelhardt wrote: > > On Friday 2010-11-26 20:48, Jozsef Kadlecsik wrote: >>>> >>>> What is that initial data handling in dumps for? >>> >>> Making an atomic snapshot/copy of the table. A userspace client >>> could take almost indefinitely on retrieving a table, so it is >>> possible that something else changes tables meanwhile. >> >> Why don't you lock the tables during dumping? That way the tables won't >> change, whatever long time the dump takes. Snapshotting the table looks as >> wasting memory and time. > > For that to work, I would have to use a locking primitive that can be > held across returns to userspace, which leaves semaphores as the only > option and, ya, I didn't quite feel like using _that_. Abusing the Netlink protocol to overcome the "supposed to be" limitation does not seem to me the way to go. Moreover, if we ever have more than X bytes rule-sets (I don't remember that limit that you have previously mentioned), you'll have to add some locking strategy anyway. The locking is the way to go. > Also sounds a > bit like a killer if an admin cannot update a table just because he > forgot some dumper process in the background in suspended state. :-/ He will notice that he did that because he hits EAGAIN, so he can kill the process in background and retry.