mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Trond Myklebust <trond.myklebust@fys.uio.no>
To: Andrea Arcangeli <andrea@suse.de>
Cc: Russell King <rmk@arm.linux.org.uk>,
	Manfred Spraul <manfred@colorfullife.com>,
	Hubert Mantel <mantel@suse.de>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>
Subject: Re: Compatibility issue with 2.2.19pre7
Date: Thu, 11 Jan 2001 19:30:49 +0100 (CET)	[thread overview]
Message-ID: <14941.64473.902580.756312@charged.uio.no> (raw)
In-Reply-To: <20010111192758.E3560@athlon.random>
In-Reply-To: <20010110013755.D13955@suse.de> <200101100654.f0A6sjJ02453@flint.arm.linux.org.uk> <20010110163158.F19503@athlon.random> <shszogy2jmr.fsf@charged.uio.no> <3A5DDD09.C8C70D36@colorfullife.com> <14941.61668.697523.866481@charged.uio.no> <shsae8y2blg.fsf@charged.uio.no> <20010111192758.E3560@athlon.random>

>>>>> " " == Andrea Arcangeli <andrea@suse.de> writes:

     > On Thu, Jan 11, 2001 at 07:22:03PM +0100, Trond Myklebust
     > wrote:
    >> [..] Are there any alignment requirements on them?

     > On some arch int can be read only at a sizeof(int) byte aligned
     > address (details in my example in reply to Russell).

OK. In that case my patch, would just be amended to eliminate the
redundant comparison as is the case below.

Cheers,
   Trond

diff -u --recursive --new-file linux-2.2.18/fs/lockd/svcsubs.c linux-2.2.18-fix_ppc/fs/lockd/svcsubs.c
--- linux-2.2.18/fs/lockd/svcsubs.c	Mon Dec 11 01:49:44 2000
+++ linux-2.2.18-fix_ppc/fs/lockd/svcsubs.c	Thu Jan 11 19:00:11 2001
@@ -49,34 +49,36 @@
 nlm_lookup_file(struct svc_rqst *rqstp, struct nlm_file **result,
 					struct nfs_fh *f)
 {
-	struct knfs_fh	*fh = (struct knfs_fh *) f->data;
+	struct knfs_fh	fh;
 	struct nlm_file	*file;
 	unsigned int	hash;
 	u32		nfserr;
 
+	/* Copy filehandle to avoid pointer alignment issues */
+	memcpy(&fh, f->data, sizeof(fh));
+
 	dprintk("lockd: nlm_file_lookup(%s/%u)\n",
-		kdevname(u32_to_kdev_t(fh->fh_dev)), fh->fh_ino);
+		kdevname(u32_to_kdev_t(fh.fh_dev)), fh.fh_ino);
 
-	hash = file_hash(u32_to_kdev_t(fh->fh_dev), u32_to_ino_t(fh->fh_ino));
+	hash = file_hash(u32_to_kdev_t(fh.fh_dev), u32_to_ino_t(fh.fh_ino));
 
 	/* Lock file table */
 	down(&nlm_file_sema);
 
 	for (file = nlm_files[hash]; file; file = file->f_next) {
-		if (file->f_handle.fh_dcookie == fh->fh_dcookie &&
-		    !memcmp(&file->f_handle, fh, sizeof(*fh)))
+		if (!memcmp(&file->f_handle, &fh, sizeof(fh)))
 			goto found;
 	}
 
 	dprintk("lockd: creating file for %s/%u\n",
-		kdevname(u32_to_kdev_t(fh->fh_dev)), fh->fh_ino);
+		kdevname(u32_to_kdev_t(fh.fh_dev)), fh.fh_ino);
 	nfserr = nlm4_lck_denied_nolocks;
 	file = (struct nlm_file *) kmalloc(sizeof(*file), GFP_KERNEL);
 	if (!file)
 		goto out_unlock;
 
 	memset(file, 0, sizeof(*file));
-	file->f_handle = *fh;
+	memcpy(&file->f_handle, &fh, sizeof(file->f_handle));
 	file->f_sema   = MUTEX;
 
 	/* Open the file. Note that this must not sleep for too long, else
@@ -85,7 +87,7 @@
 	 * We have to make sure we have the right credential to open
 	 * the file.
 	 */
-	if ((nfserr = nlmsvc_ops->fopen(rqstp, fh, &file->f_file)) != 0) {
+	if ((nfserr = nlmsvc_ops->fopen(rqstp, &fh, &file->f_file)) != 0) {
 		dprintk("lockd: open failed (nfserr %d)\n", ntohl(nfserr));
 		goto out_free;
 	}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

  parent reply	other threads:[~2001-01-11 18:31 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-10  0:37 Hubert Mantel
2001-01-10  0:43 ` Alan Cox
2001-01-10  6:54 ` Russell King
2001-01-10 15:31   ` Andrea Arcangeli
2001-01-10 22:09     ` Russell King
2001-01-10 23:59       ` Andrea Arcangeli
2001-01-11  7:34         ` Russell King
2001-01-11 10:33           ` Andi Kleen
2001-01-11 10:36             ` Russell King
2001-01-11 12:10           ` Manfred
2001-01-11 12:10             ` Andi Kleen
2001-01-11 12:29               ` Manfred
2001-01-11 13:27                 ` Russell King
2001-01-24  7:51         ` Richard Henderson
2001-01-24  9:02           ` Andrea Arcangeli
2001-01-24  9:51             ` Richard Henderson
2001-01-24 12:21               ` Andrea Arcangeli
2001-01-24 17:49                 ` Richard Henderson
2001-01-24 10:09             ` Thomas Pornin
2001-01-11 15:28     ` Trond Myklebust
2001-01-11 16:19       ` Manfred Spraul
2001-01-11 17:44       ` Trond Myklebust
2001-01-11 18:22         ` Trond Myklebust
2001-01-11 18:27           ` Andrea Arcangeli
2001-01-11 18:30           ` Trond Myklebust [this message]
2001-01-11 18:43             ` Andrea Arcangeli
2001-01-11 20:09               ` Russell King
2001-01-11 20:39             ` Trond Myklebust
2001-01-11 11:37   ` Trond Myklebust
2001-01-24 13:46 Jesse Pollard

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=14941.64473.902580.756312@charged.uio.no \
    --to=trond.myklebust@fys.uio.no \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=andrea@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manfred@colorfullife.com \
    --cc=mantel@suse.de \
    --cc=rmk@arm.linux.org.uk \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®