From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sukadev Bhattiprolu Subject: [RFC][PATCH 0/6][cr]: Checkpoint/restart file locks and leases Date: Tue, 4 May 2010 22:30:16 -0700 Message-ID: <20100505053016.GA20483@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Containers , linux-fsdevel@vger.kernel.org, serue@us.ibm.com, matthltc@us.ibm.com, sukadev@us.ibm.com To: Oren Laadan Return-path: Received: from e39.co.us.ibm.com ([32.97.110.160]:40811 "EHLO e39.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755047Ab0EEFYI (ORCPT ); Wed, 5 May 2010 01:24:08 -0400 Received: from d03relay01.boulder.ibm.com (d03relay01.boulder.ibm.com [9.17.195.226]) by e39.co.us.ibm.com (8.14.3/8.13.1) with ESMTP id o455FY2u026263 for ; Tue, 4 May 2010 23:15:34 -0600 Received: from d03av03.boulder.ibm.com (d03av03.boulder.ibm.com [9.17.195.169]) by d03relay01.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o455O7IO155668 for ; Tue, 4 May 2010 23:24:07 -0600 Received: from d03av03.boulder.ibm.com (loopback [127.0.0.1]) by d03av03.boulder.ibm.com (8.14.3/8.13.1/NCO v10.0 AVout) with ESMTP id o44MO5AW008295 for ; Tue, 4 May 2010 16:24:06 -0600 Content-Disposition: inline Sender: linux-fsdevel-owner@vger.kernel.org List-ID: This patchset is an early draft of checkpoint/restart of file-locks/leases. This patchset applies on top of the ckpt-v21-rc7 branch of the Checkpoint/ restart git tree (see http://ckpt.wiki.kernel.org for details). To checkpoint/restart file-locks and leases we find each lock/lease held by each fd of the process and save the information about the lock/lease in the checkpoint-image. When restarting, each process reacquires the locks it held at checkpoint. When all processes have acquired the locks one-by-one, the entire process tree is allowed to execute. Any processes blocked on a lock at the time of checkpoint, restart their system call and end up blocking on the lock again after the restart. Checkpoint/restart of file-leases, specially the leases that are being revoked appear to be more tricky - Patch 6/6 has the details. [PATCH 1/6] Move file_lock macros into linux/fs.h [PATCH 2/6] Checkpoint file-locks [PATCH 3/6] Define flock_set() [PATCH 4/6] Restore file-locks [PATCH 5/6] Define do_setlease() [PATCH 6/6] Checkpoint/restart file leases This patchset has been gently tested with a few C/R testcases and needs more testing. Pls let me know your comments or if there are semantics that might change. Patch 6 identifies a couple of semantics for leases and suggests a way to preserve them. But maybe there is a cleaner/easier way to do so. Note: For consistency with current uses of for_each_lock(), this patchset uses lock_kernel(), but not sure yet if it is required. Signed-off-by: Sukadev Bhattiprolu