Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755848Ab2KMU3l (ORCPT ); Tue, 13 Nov 2012 15:29:41 -0500 Received: from mail-la0-f46.google.com ([209.85.215.46]:47911 "EHLO mail-la0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755812Ab2KMU1q (ORCPT ); Tue, 13 Nov 2012 15:27:46 -0500 Message-Id: <20121113202739.062864800@openvz.org> User-Agent: quilt/0.48-1 Date: Wed, 14 Nov 2012 00:20:27 +0400 From: Cyrill Gorcunov To: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Cc: Al Viro , Alexey Dobriyan , Andrew Morton , Pavel Emelyanov , James Bottomley , Matthew Helsley , aneesh.kumar@linux.vnet.ibm.com, bfields@fieldses.org, oleg@redhat.com, rientjes@google.com, Cyrill Gorcunov , Al Viro Subject: [patch 4/7] fs, exportfs: Escape nil dereference if no s_export_op present References: <20121113202023.748833257@openvz.org> Content-Disposition: inline; filename=fs-exportfs-add-null-check Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1549 Lines: 39 This routine will be used to generate a file handle in fdinfo output for inotify subsystem, where if no s_export_op present the general export_encode_fh should be used. Thus add a test if s_export_op present inside exportfs_encode_fh itself. Signed-off-by: Cyrill Gorcunov CC: Pavel Emelyanov CC: Al Viro CC: Alexey Dobriyan CC: Andrew Morton CC: James Bottomley CC: "Aneesh Kumar K.V" CC: Alexey Dobriyan CC: Matthew Helsley CC: "J. Bruce Fields" CC: "Aneesh Kumar K.V" --- fs/exportfs/expfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: linux-2.6.git/fs/exportfs/expfs.c =================================================================== --- linux-2.6.git.orig/fs/exportfs/expfs.c +++ linux-2.6.git/fs/exportfs/expfs.c @@ -357,7 +357,7 @@ int exportfs_encode_fh(struct dentry *de */ parent = p->d_inode; } - if (nop->encode_fh) + if (nop && nop->encode_fh) error = nop->encode_fh(inode, fid->raw, max_len, parent); else error = export_encode_fh(inode, fid, max_len, parent); -- 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/