From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nathan Lynch Subject: Re: [RFC cr-pipe-v13][PATCH 2/3] Checkpoint open pipes Date: Thu, 5 Feb 2009 20:26:37 -0600 Message-ID: <20090205202637.4d4f4a29@thinkcentre.lan> References: <1233091395-24582-1-git-send-email-orenl@cs.columbia.edu> <1233091395-24582-4-git-send-email-orenl@cs.columbia.edu> <498AB553.3090902@fr.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <498AB553.3090902-NmTC/0ZBporQT0dZR+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: Cedric Le Goater Cc: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, Dave Hansen List-Id: containers.vger.kernel.org On Thu, 05 Feb 2009 10:45:55 +0100 Cedric Le Goater wrote: > > > > +/* cr_write_pipebuf - dump contents of a pipe/fifo (assume i_mutex taken) */ > > +static int cr_write_pipebuf(struct cr_ctx *ctx, struct pipe_inode_info *pipe) > > +{ > > + struct cr_hdr h; > > + void *kbuf, *addr; > > + int i, ret = 0; > > + > > + kbuf = (void *) __get_free_page(GFP_KERNEL); > > this can sleep and inode->i_mutex is locked. Generally, it is okay to perform operations that may sleep while holding a mutex (not so with spinlocks, though). Unless the page allocator could try to acquire the same inode->i_mutex, this code should be fine, no?