From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jonathan Corbet Date: Tue, 29 Jul 2014 14:58:08 -0400 Subject: [Cluster-devel] [RFC PATCH 5/5] gfs2: Add xreaddir file operation and supporting functions In-Reply-To: <1406309888-10749-6-git-send-email-adas@redhat.com> References: <1406309888-10749-1-git-send-email-adas@redhat.com> <1406309888-10749-6-git-send-email-adas@redhat.com> Message-ID: <20140729145808.79bec165@lwn.net> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On Fri, 25 Jul 2014 12:38:08 -0500 Abhi Das wrote: > This patch adds support in GFS2 for the xgetdents syscall by > implementing the xreaddir file operation. So I was trying to make sense of this, and ran into one little thing that jumped out at me: > +static int gfs2_xrdir_to_user_vars(struct gfs2_xrdir_ctx *xc, > + struct gfs2_xdirent *x, > + struct gfs2_xdirent *x_vb_p, > + struct linux_xdirent __user *lxd, > + size_t count, size_t *bytes) Now, I'll readily admit that I could be overly confused by this function. When the variables are named "x", "xx", "xc", "x_vb_p", "xblob", and "lxd", it all starts to run together. But still... > + if ((xc->xc_xattr_mask & XSTAT_XATTR_ALL) && > + lxd->xd_blob.xb_xattr_count) { How can that be right? lxd is __user, it doesn't seem right to be dereferencing it directly...? Thanks, jon From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jonathan Corbet Subject: Re: [RFC PATCH 5/5] gfs2: Add xreaddir file operation and supporting functions Date: Tue, 29 Jul 2014 14:58:08 -0400 Message-ID: <20140729145808.79bec165@lwn.net> References: <1406309888-10749-1-git-send-email-adas@redhat.com> <1406309888-10749-6-git-send-email-adas@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8bit Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, cluster-devel@redhat.com To: Abhi Das Return-path: Received: from tex.lwn.net ([70.33.254.29]:38735 "EHLO vena.lwn.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751165AbaG2TPd (ORCPT ); Tue, 29 Jul 2014 15:15:33 -0400 In-Reply-To: <1406309888-10749-6-git-send-email-adas@redhat.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Fri, 25 Jul 2014 12:38:08 -0500 Abhi Das wrote: > This patch adds support in GFS2 for the xgetdents syscall by > implementing the xreaddir file operation. So I was trying to make sense of this, and ran into one little thing that jumped out at me: > +static int gfs2_xrdir_to_user_vars(struct gfs2_xrdir_ctx *xc, > + struct gfs2_xdirent *x, > + struct gfs2_xdirent *x_vb_p, > + struct linux_xdirent __user *lxd, > + size_t count, size_t *bytes) Now, I'll readily admit that I could be overly confused by this function. When the variables are named "x", "xx", "xc", "x_vb_p", "xblob", and "lxd", it all starts to run together. But still... > + if ((xc->xc_xattr_mask & XSTAT_XATTR_ALL) && > + lxd->xd_blob.xb_xattr_count) { How can that be right? lxd is __user, it doesn't seem right to be dereferencing it directly...? Thanks, jon