Linux-Fsdevel Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Al Viro <viro@zeniv.linux.org.uk>
Cc: Christoph Hellwig <hch@lst.de>,
	x86@kernel.org, Jan Kara <jack@suse.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-api@vger.kernel.org, linux-arch@vger.kernel.org
Subject: Re: [PATCH 4/4] quota: simplify the quotactl compat handling
Date: Sun, 26 Jul 2020 18:34:22 +0200	[thread overview]
Message-ID: <20200726163422.GA24657@lst.de> (raw)
In-Reply-To: <20200726163214.GS2786714@ZenIV.linux.org.uk>

On Sun, Jul 26, 2020 at 05:32:14PM +0100, Al Viro wrote:
> > +static int compat_copy_fs_qfilestat(struct compat_fs_qfilestat __user *to,
> > +		struct fs_qfilestat *from)
> > +{
> > +	if (copy_to_user(to, from, sizeof(*to)) ||
> > +	    put_user(from->qfs_nextents, &to->qfs_nextents))
> > +		return -EFAULT;
> > +	return 0;
> > +}
> 
> do we have any need of that put_user()?  Note that you don't even call
> that thing unless compat_need_64bit_alignment_fixup() is true.  And AFAICS
> all such cases are little-endian...

The main reason it is there is to preserve the previous semantics.
And no, I don't think we actually need it on x86.  But what if some
poor souls adds a BE version that needs this?  E.g. arm oabi has similar
weird alignment, and now imagine someone adding arm64 compat code for
that..

  reply	other threads:[~2020-07-26 16:34 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-26 16:03 improve compat handling for the i386 u64 alignment quirk Christoph Hellwig
2020-07-26 16:03 ` [PATCH 1/4] arm64: stop using <asm/compat.h> directly Christoph Hellwig
2020-07-30 17:34   ` Nathan Chancellor
2020-07-31  8:41     ` Naresh Kamboju
2020-07-26 16:03 ` [PATCH 2/4] compat: lift compat_s64 and compat_u64 to <linux/compat.h> Christoph Hellwig
2020-07-29  6:08   ` [PATCH 2/4 v2] " Christoph Hellwig
2020-07-26 16:04 ` [PATCH 3/4] compat: add a compat_need_64bit_alignment_fixup() helper Christoph Hellwig
2020-07-26 16:04 ` [PATCH 4/4] quota: simplify the quotactl compat handling Christoph Hellwig
2020-07-26 16:32   ` Al Viro
2020-07-26 16:34     ` Christoph Hellwig [this message]
2020-07-26 16:37       ` Al Viro
2020-07-27 12:41   ` Jan Kara
2020-07-27 15:56     ` Al Viro
2020-07-27 21:31       ` Jan Kara
2020-07-28  1:49         ` Al Viro

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200726163422.GA24657@lst.de \
    --to=hch@lst.de \
    --cc=jack@suse.com \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=x86@kernel.org \
    --subject='Re: [PATCH 4/4] quota: simplify the quotactl compat handling' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).