mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Randy Dunlap <rdunlap@xenotime.net>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Jeff Mahoney <jeffm@suse.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] mmap: restore -ENODEV on missing f_op->mmap
Date: Tue, 30 Oct 2007 16:13:52 -0700	[thread overview]
Message-ID: <20071030161352.80656280.rdunlap@xenotime.net> (raw)
In-Reply-To: <alpine.LFD.0.999.0710301541050.30120@woody.linux-foundation.org>

On Tue, 30 Oct 2007 15:45:56 -0700 (PDT) Linus Torvalds wrote:

> 
> 
> On Tue, 30 Oct 2007, Jeff Mahoney wrote:
> > 
> >  Personally, I think this is probably a case of LTP codifying existing
> >  behavior rather than testing the for the specification. If that's the case
> >  and nobody really cares about the change in behavior, I'm fine letting this
> >  drop.
> 
> Hmm.. I think it's kind of stupid adding that special case early on, just 
> to get one particular error case return when there are multiple possible 
> ones. 
> 
> I don't care deeply, but this does smell like a test issue rather than a 
> code issue.
> 
> Looking at that path, there are *other* things that might be worth 
> cleaning up, but this wasn't one of them..


Jeff, will you (at least) notify the LTP project of this issue and
need for a patch?

Thanks.

> ---
> diff --git a/mm/mmap.c b/mm/mmap.c
> index facc1a7..fe286f7 100644
> --- a/mm/mmap.c
> +++ b/mm/mmap.c
> @@ -893,7 +893,6 @@ unsigned long do_mmap_pgoff(struct file * file, unsigned long addr,
>  			unsigned long flags, unsigned long pgoff)
>  {
>  	struct mm_struct * mm = current->mm;
> -	struct inode *inode;
>  	unsigned int vm_flags;
>  	int error;
>  	int accountable = 1;
> @@ -959,9 +958,9 @@ unsigned long do_mmap_pgoff(struct file * file, unsigned long addr,
>  			return -EAGAIN;
>  	}
>  
> -	inode = file ? file->f_path.dentry->d_inode : NULL;
> -
>  	if (file) {
> +		struct inode *inode = file->f_path.dentry->d_inode;
> +
>  		switch (flags & MAP_TYPE) {
>  		case MAP_SHARED:
>  			if ((prot&PROT_WRITE) && !(file->f_mode&FMODE_WRITE))
> -

---
~Randy

  reply	other threads:[~2007-10-30 23:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-30 22:20 Jeff Mahoney
2007-10-30 22:45 ` Linus Torvalds
2007-10-30 23:13   ` Randy Dunlap [this message]
2007-10-31  1:07     ` Jeff Mahoney
2007-10-31  1:07   ` Jeff Mahoney

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=20071030161352.80656280.rdunlap@xenotime.net \
    --to=rdunlap@xenotime.net \
    --cc=akpm@linux-foundation.org \
    --cc=jeffm@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /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®