Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760515AbaJ3Onq (ORCPT ); Thu, 30 Oct 2014 10:43:46 -0400 Received: from mail-qg0-f53.google.com ([209.85.192.53]:35899 "EHLO mail-qg0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758190AbaJ3Onp (ORCPT ); Thu, 30 Oct 2014 10:43:45 -0400 MIME-Version: 1.0 X-Originating-IP: [46.139.80.5] In-Reply-To: <20141030141004.28203.79687.stgit@warthog.procyon.org.uk> References: <20141030141004.28203.79687.stgit@warthog.procyon.org.uk> Date: Thu, 30 Oct 2014 15:36:02 +0100 Message-ID: Subject: Re: [PATCH] Overlayfs: ovl_fill_merge() should use container_of() rather than direct cast From: Miklos Szeredi To: David Howells Cc: Al Viro , Linux-Fsdevel , linux-unionfs@vger.kernel.org, Kernel Mailing List Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 30, 2014 at 3:10 PM, David Howells wrote: > ovl_fill_merge() effectively directly casts the buf pointer to an > ovl_readdir_data struct pointer, but the pointer actually points to the > dir_context struct contained therein. > > So use container_of() instead. > > Signed-off-by: David Howells Okay, but why don't we have a typed argument of actor then? Being typeless is encouraging exactly the kind of games overlayfs is doing (probably copied mindlessly from some other part of the kernel). Thanks, Miklos -- 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/