From mboxrd@z Thu Jan 1 00:00:00 1970 From: Oren Laadan Subject: Re: [RFC v14-rc][PATCH 09/23] Dump open file descriptors Date: Tue, 24 Mar 2009 11:37:29 -0400 Message-ID: <49C8FE39.6040605@cs.columbia.edu> References: <1237574868-3371-1-git-send-email-orenl@cs.columbia.edu> <1237574868-3371-10-git-send-email-orenl@cs.columbia.edu> <1237579789.8286.242.camel@nimitz> <49C402BE.4010308@cs.columbia.edu> <1237583640.8286.296.camel@nimitz> <20090324152442.GA18066@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20090324152442.GA18066-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: "Serge E. Hallyn" Cc: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, Dave Hansen List-Id: containers.vger.kernel.org Serge E. Hallyn wrote: > Quoting Dave Hansen (dave-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org): >> On Fri, 2009-03-20 at 16:55 -0400, Oren Laadan wrote: >>> Dave Hansen wrote: >>>> On Fri, 2009-03-20 at 14:47 -0400, Oren Laadan wrote: >>>>> + switch (inode->i_mode & S_IFMT) { >>>>> + case S_IFREG: >>>>> + fd_type = CR_FD_FILE; >>>>> + break; >>>>> + case S_IFDIR: >>>>> + fd_type = CR_FD_DIR; >>>>> + break; >>>>> + default: >>>>> + cr_hbuf_put(ctx, sizeof(*hh)); >>>>> + return -EBADF; >>>>> + } >>>> Why is there differentiation between files and directories? Since we >>>> deal with them in the same way, why bother adding this code everywhere >>>> to make them distinct? >>> When we will handle unlinked files and unlinked directories, they will >>> be handled differently. >> This at *LEAST* needs a big fat comment. >> >> ... and unlinked files will be handled differently than normal files. >> Can we cross that bridge when we come to it? The abstraction that I >> drew before in my patch was this: >> >> CR_FD_GENERIC >> >> It means an fd the can be checkpointed/restored in a "generic" way, >> namely "open()/lseek()", done. Linked directories and linked files >> share this attribute. Unlinked files/directories do not. >> >> Is it more important that we classify things based on the file/directory >> properties, or how we handle them? > > Did this thread die because we expect Dave's fops patch to make > this absolete? and I thought it just ended :) (in fact the change is already in the current ckpt-v14 git tree). Oren.