Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966269AbYCSVXp (ORCPT ); Wed, 19 Mar 2008 17:23:45 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1762040AbYCSUAQ (ORCPT ); Wed, 19 Mar 2008 16:00:16 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:48863 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754868AbYCSUAI (ORCPT ); Wed, 19 Mar 2008 16:00:08 -0400 Date: Wed, 19 Mar 2008 11:37:04 +0000 From: Al Viro To: Miklos Szeredi Cc: akpm@linux-foundation.org, linuxram@us.ibm.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [patch 4/6] vfs: mountinfo show dominating group id Message-ID: <20080319113704.GJ10722@ZenIV.linux.org.uk> References: <20080313212641.989467982@szeredi.hu> <20080313212737.053993902@szeredi.hu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080313212737.053993902@szeredi.hu> User-Agent: Mutt/1.4.2.3i Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1311 Lines: 30 On Thu, Mar 13, 2008 at 10:26:45PM +0100, Miklos Szeredi wrote: > From: Miklos Szeredi > > Show peer group ID of nearest dominating group that has intersection > with the mount's namespace. There's an obvious problem here: ->show_options() can spew _anything_, including a string that ends on " shared:42". Makes reliable parsing of the damn thing in userland impossible. IOW, fs options should go _last_ and they should follow an unconditionally present field. > if (sb->s_op->show_options) > err = sb->s_op->show_options(m, mnt); > - if (IS_MNT_SHARED(mnt)) { > - seq_printf(m, " shared:%i", get_peer_group_id(mnt)); > - if (IS_MNT_SLAVE(mnt)) > - seq_printf(m, ",slave:%i", get_master_id(mnt)); > - } else if (IS_MNT_SLAVE(mnt)) { > - seq_printf(m, " slave:%i", get_master_id(mnt)); > + seq_putc(m, ' '); > + if (IS_MNT_SHARED(mnt) || IS_MNT_SLAVE(mnt)) { > + if (IS_MNT_SHARED(mnt)) > + seq_printf(m, "shared:%i", get_peer_group_id(mnt)); > + if (IS_MNT_SLAVE(mnt)) { > + int dominator_id = get_dominator_id_same_ns(mnt); -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/