From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pekka Enberg Subject: Re: [RFC][patch 2/7] v9fs: VFS file and directory operations (2.0-rc6) Date: Tue, 24 May 2005 10:14:12 +0300 Message-ID: <84144f0205052400143e97796e@mail.gmail.com> References: <200505232225.j4NMPXe1029024@ms-smtp-02-eri0.texas.rr.com> Reply-To: Pekka Enberg Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT Cc: linux-kernel@vger.kernel.org, v9fs-developer@lists.sourceforge.net, viro@parcelfarce.linux.theplanet.co.uk, linux-fsdevel@vger.kernel.org, penberg@cs.helsinki.fi Return-path: Received: from wproxy.gmail.com ([64.233.184.194]:58446 "EHLO wproxy.gmail.com") by vger.kernel.org with ESMTP id S261389AbVEXHON convert rfc822-to-8bit (ORCPT ); Tue, 24 May 2005 03:14:13 -0400 Received: by wproxy.gmail.com with SMTP id 68so2500607wri for ; Tue, 24 May 2005 00:14:13 -0700 (PDT) To: "ericvh@gmail.com" In-Reply-To: <200505232225.j4NMPXe1029024@ms-smtp-02-eri0.texas.rr.com> Content-Disposition: inline Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org Hi, On 5/24/05, ericvh@gmail.com wrote: > +static ssize_t > +v9fs_file_write(struct file *filp, const char __user * data, > + size_t count, loff_t * offset) > +{ > + int ret = -1; > + char *buffer; > + > + buffer = kmalloc(count, GFP_KERNEL); > + if (buffer == NULL) { > + BUG(); I think simply returning -ENOMEM is sufficient. BUG seems way too aggressive. (Found this in other places as well.) > + return -ENOMEM; > + } Pekka