From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from 173-166-109-252-newengland.hfc.comcastbusiness.net ([173.166.109.252]:45314 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752392Ab1IINDA (ORCPT ); Fri, 9 Sep 2011 09:03:00 -0400 Date: Fri, 9 Sep 2011 09:02:57 -0400 From: Christoph Hellwig To: Mel Gorman Cc: Linux-MM , Linux-Netdev , Linux-NFS , LKML , Andrew Morton , David Miller , Trond Myklebust , Neil Brown , Peter Zijlstra Subject: Re: [PATCH 10/10] Avoid dereferencing bd_disk during swap_entry_free for network storage Message-ID: <20110909130257.GA15212@infradead.org> References: <1315566054-17209-1-git-send-email-mgorman@suse.de> <1315566054-17209-11-git-send-email-mgorman@suse.de> Content-Type: text/plain; charset=us-ascii In-Reply-To: <1315566054-17209-11-git-send-email-mgorman@suse.de> Sender: linux-nfs-owner@vger.kernel.org List-ID: MIME-Version: 1.0 On Fri, Sep 09, 2011 at 12:00:54PM +0100, Mel Gorman wrote: > Commit [b3a27d: swap: Add swap slot free callback to > block_device_operations] dereferences p->bdev->bd_disk but this is a > NULL dereference if using swap-over-NFS. This patch checks SWP_BLKDEV > on the swap_info_struct before dereferencing. Please just remove the callback entirely. It has no user outside the staging tree and was added clearly against the rules for that staging tree. (and it's butt ugly)