From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tyler Hicks Subject: Re: [PATCH] ecryptfs: pass matching flags to interpose as defined and used there Date: Mon, 7 Dec 2009 16:40:14 -0600 Message-ID: <20091207224014.GA10148@fedora-virt> References: <200912062351.nB6NpFZF030262@agora.fsl.cs.sunysb.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Dustin Kirkland , Andrew Morton , viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org To: Erez Zadok Return-path: Received: from e5.ny.us.ibm.com ([32.97.182.145]:52083 "EHLO e5.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758321AbZLGWkN (ORCPT ); Mon, 7 Dec 2009 17:40:13 -0500 Received: from d01relay03.pok.ibm.com (d01relay03.pok.ibm.com [9.56.227.235]) by e5.ny.us.ibm.com (8.14.3/8.13.1) with ESMTP id nB7MT1Sn014898 for ; Mon, 7 Dec 2009 17:29:01 -0500 Received: from d01av01.pok.ibm.com (d01av01.pok.ibm.com [9.56.224.215]) by d01relay03.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id nB7MeJcm140996 for ; Mon, 7 Dec 2009 17:40:19 -0500 Received: from d01av01.pok.ibm.com (loopback [127.0.0.1]) by d01av01.pok.ibm.com (8.14.3/8.13.1/NCO v10.0 AVout) with ESMTP id nB7MeImx016383 for ; Mon, 7 Dec 2009 17:40:19 -0500 Content-Disposition: inline In-Reply-To: <200912062351.nB6NpFZF030262@agora.fsl.cs.sunysb.edu> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Sun Dec 06, 2009 at 06:51:15PM -0500, Erez Zadok (ezk@cs.sunysb.edu) was quoted: > > ecryptfs: pass matching flags to interpose as defined and used there > > ecryptfs_interpose checks if one of the flags passed is > ECRYPTFS_INTERPOSE_FLAG_D_ADD, defined as 0x00000001 in ecryptfs_kernel.h. > But the only user of ecryptfs_interpose to pass a non-zero flag to it, has > hard-coded the value as "1". This could spell trouble if any of these values > changes in the future. > > Signed-off-by: Erez Zadok Nice catch! Thanks again! Applied to git://git.kernel.org/pub/scm/linux/kernel/git/ecryptfs/ecryptfs-2.6.git#next > diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c > index 91a5dba..dd5d1ba 100644 > --- a/fs/ecryptfs/inode.c > +++ b/fs/ecryptfs/inode.c > @@ -282,7 +282,8 @@ int ecryptfs_lookup_and_interpose_lower(struct dentry *ecryptfs_dentry, > goto out; > } > rc = ecryptfs_interpose(lower_dentry, ecryptfs_dentry, > - ecryptfs_dir_inode->i_sb, 1); > + ecryptfs_dir_inode->i_sb, > + ECRYPTFS_INTERPOSE_FLAG_D_ADD); > if (rc) { > printk(KERN_ERR "%s: Error interposing; rc = [%d]\n", > __func__, rc);