public inbox for linux-fsdevel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrea Arcangeli <andrea@suse.de>
To: Andi Kleen <ak@muc.de>
Cc: marcelo.tosatti@cyclades.com.br, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] Mask out O_LARGEFILE in F_GETFL
Date: Wed, 1 Oct 2003 15:24:01 +0200	[thread overview]
Message-ID: <20031001132401.GK17274@velociraptor.random> (raw)
In-Reply-To: <20030925052508.GA2374@averell>

Hi,

On Thu, Sep 25, 2003 at 07:25:08AM +0200, Andi Kleen wrote:
> 
> This fixes a test in the LSB test suite. 
> 
> The kernel sets O_LARGEFILE implicitely on 64bit hosts.
> According to POSIX it should not appear on F_GETFL then. Just mask it out
> always. 
> 
> This will also mask it out for explicitely set O_LARGEFILE, but that seems
> to be ok.
> 
> Any flames for this please to the POSIX comittee, not to me.
> 
> -Andi
> 
> diff -X ../../KDIFX -burpN linux-2.4.23-pre5/fs/fcntl.c linux-merge/fs/fcntl.c
> --- linux-2.4.23-pre5/fs/fcntl.c	2002-11-30 00:37:11.000000000 +0100
> +++ linux-merge/fs/fcntl.c	2002-11-30 05:22:20.000000000 +0100
> @@ -270,7 +270,7 @@ static long do_fcntl(unsigned int fd, un
>  			set_close_on_exec(fd, arg&1);
>  			break;
>  		case F_GETFL:
> -			err = filp->f_flags;
> +			err = filp->f_flags & ~O_LARGEFILE;
>  			break;
>  		case F_SETFL:
>  			lock_kernel();
> 

I guess you got bitten because you're running 64bit where glibc isn't
supposed to deal with it.

AFIK it's up to glibc to clean it up on 32bit systems if you don't ask
for largefile mode.

this is what I've on my tree since a long time and it should be the
right fix.

#if BITS_PER_LONG != 32
			err = filp->f_flags & ~O_LARGEFILE;
#else
			err = filp->f_flags;
#endif

	http://www.us.kernel.org/pub/linux/kernel/people/andrea/kernels/v2.4/2.4.22aa1/00_fcntl_getfl-largefile-1

Andrea - If you prefer relying on open source software, check these links:
	    rsync.kernel.org::pub/scm/linux/kernel/bkcvs/linux-2.[45]/
	    http://www.cobite.com/cvsps/

      reply	other threads:[~2003-10-01 13:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-25  5:25 [PATCH] Mask out O_LARGEFILE in F_GETFL Andi Kleen
2003-10-01 13:24 ` Andrea Arcangeli [this message]

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=20031001132401.GK17274@velociraptor.random \
    --to=andrea@suse.de \
    --cc=ak@muc.de \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=marcelo.tosatti@cyclades.com.br \
    /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