From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sukadev Bhattiprolu Subject: Re: [RFC][PATCH 1/3][cr][v2]: Define do_setlease() Date: Wed, 26 May 2010 10:14:50 -0700 Message-ID: <20100526171450.GA26188@us.ibm.com> References: <1274836063-13271-1-git-send-email-sukadev@linux.vnet.ibm.com> <1274836063-13271-2-git-send-email-sukadev@linux.vnet.ibm.com> <20100526135256.GA25799@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Oren Laadan , Matt Helsley , matthew@wil.cx, linux-fsdevel@vger.kernel.org, Containers To: "Serge E. Hallyn" Return-path: Received: from e2.ny.us.ibm.com ([32.97.182.142]:59403 "EHLO e2.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751823Ab0EZRHs (ORCPT ); Wed, 26 May 2010 13:07:48 -0400 Received: from d01relay06.pok.ibm.com (d01relay06.pok.ibm.com [9.56.227.116]) by e2.ny.us.ibm.com (8.14.3/8.13.1) with ESMTP id o4QGtXNp015795 for ; Wed, 26 May 2010 12:55:33 -0400 Received: from d01av04.pok.ibm.com (d01av04.pok.ibm.com [9.56.224.64]) by d01relay06.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o4QH7aOq1716288 for ; Wed, 26 May 2010 13:07:39 -0400 Received: from d01av04.pok.ibm.com (loopback [127.0.0.1]) by d01av04.pok.ibm.com (8.14.3/8.13.1/NCO v10.0 AVout) with ESMTP id o4QH7ZSi002662 for ; Wed, 26 May 2010 13:07:36 -0400 Content-Disposition: inline In-Reply-To: <20100526135256.GA25799@us.ibm.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Serge E. Hallyn [serue@us.ibm.com] wrote: | Quoting Sukadev Bhattiprolu (sukadev@linux.vnet.ibm.com): | > Move the core functionality of fcntl_setlease() into a new function, | > do_setlease(). do_setlease() is same as fcntl_setlease() except that | > it takes an extra 'rem_lease' parameter. do_setlease() will be used | > in a follow-on patch to checkpoint/restart file-leases. | > | > Signed-off-by: Sukadev Bhattiprolu | > --- | > fs/locks.c | 27 ++++++++++++++++----------- | > include/linux/fs.h | 1 + | > 2 files changed, 17 insertions(+), 11 deletions(-) | > | > diff --git a/fs/locks.c b/fs/locks.c | > index c62ab7f..4107295 100644 | > --- a/fs/locks.c | > +++ b/fs/locks.c | > @@ -1471,17 +1471,7 @@ int vfs_setlease(struct file *filp, long arg, struct file_lock **lease) | > } | > EXPORT_SYMBOL_GPL(vfs_setlease); | > | > -/** | > - * fcntl_setlease - sets a lease on an open file | > - * @fd: open file descriptor | > - * @filp: file pointer | > - * @arg: type of lease to obtain | > - * | > - * Call this fcntl to establish a lease on the file. | > - * Note that you also need to call %F_SETSIG to | > - * receive a signal when the lease is broken. | > - */ | > -int fcntl_setlease(unsigned int fd, struct file *filp, long arg) | > +int do_setlease(unsigned int fd, struct file *filp, long arg, int rem_lease) | > { | | Note that rem_lease arg here is int, but the value you're checkpointing | and passing in is unsigned long. So userspace on 64-bit could easily | overflow that, though not sure to what end. Also putting 'unsigned long' | in the checkpoint_hdr.h is not in keeping with the rest of that file. lease_break_time is an int, so I set rem_lease to int. But the unsigned long in checkpoint_hdr.h is just wrong. I will change it __s32. Sukadev