Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754185Ab1C1D7V (ORCPT ); Sun, 27 Mar 2011 23:59:21 -0400 Received: from smtp1.linux-foundation.org ([140.211.169.13]:45106 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754109Ab1C1D7S (ORCPT ); Sun, 27 Mar 2011 23:59:18 -0400 MIME-Version: 1.0 In-Reply-To: <1301284006-18808-1-git-send-email-amwang@redhat.com> References: <20110327175203.GA15862@fibrous.localdomain> <1301284006-18808-1-git-send-email-amwang@redhat.com> From: Linus Torvalds Date: Sun, 27 Mar 2011 20:58:10 -0700 Message-ID: Subject: Re: [Patch] proc: check error pointer returned by m_start() To: Amerigo Wang Cc: linux-kernel@vger.kernel.org, Al Viro , WANG Cong , Andrew Morton , Eric B Munson , David Rientjes , Dave Hansen , Mel Gorman Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1135 Lines: 25 On Sun, Mar 27, 2011 at 8:46 PM, Amerigo Wang wrote: > > This is true, that commit changed the return value of m_start(), > which will return an error pointer on failure, but Al forgot > to check the error pointer in m_stop() which will be called > when m_start() fails. This patches fixes it. I did this slightly differently, and put the check in m_stop() instead, because I felt that matched the logic of m_start, while vma_stop() is more of an internal helper thing. I dunno. I don't think it matters. But one thing I reacted to was that when I was walking through the logic, I really wanted to say "seq_file is wrong to call m_stop if m_start returned an error code". I really felt like "hwy, if ->start fails, we damn well shouldn't have called ->stop". But I guess we're stuck with that particular semantic for seq_files by now. Linus -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/