From: Jesper Juhl <jesper.juhl@gmail.com>
To: Peter Staubach <staubach@redhat.com>
Cc: Eric Dumazet <dada1@cosmosbay.com>, Andrew Morton <akpm@osdl.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Suppress deprecated f_maxcount in 'struct file'
Date: Mon, 22 Aug 2005 23:57:19 +0200 [thread overview]
Message-ID: <9a87484905082214573a50c58b@mail.gmail.com> (raw)
In-Reply-To: <4309CE32.50408@redhat.com>
On 8/22/05, Peter Staubach <staubach@redhat.com> wrote:
> Eric Dumazet wrote:
>
> > Andrew Morton a écrit :
> >
> >> Eric Dumazet <dada1@cosmosbay.com> wrote:
> >>
> >>> Considering :
> >>>
> >>> [root@dada1 linux-2.6.13-rc6]# find .|xargs grep f_maxcount
> >>> ./fs/file_table.c: f->f_maxcount = INT_MAX;
> >>> ./fs/read_write.c: if (unlikely(count > file->f_maxcount))
> >>> ./include/linux/fs.h: size_t f_maxcount;
> >>>
> >>>
> >>> I was wondering if f_maxcount has a real use these days...
> >>
> >>
> >>
> >> No, I guess we can just stick a hard-wired INT_MAX in there.
> >>
> >>
> >
> > OK here is a patch doing the hard wiring then :)
> >
> > * struct file cleanup : f_maxcount has an unique value (INT_MAX). Just
> > use the hard-wired value.
> >
> > Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
> >
> >------------------------------------------------------------------------
> >diff -Nru linux-2.6.13-rc6/fs/read_write.c linux-2.6.13-rc6-ed/fs/read_write.c
> >--- linux-2.6.13-rc6/fs/read_write.c 2005-08-07 20:18:56.000000000 +0200
> >+++ linux-2.6.13-rc6-ed/fs/read_write.c 2005-08-19 23:51:20.000000000 +0200
> >@@ -188,7 +188,7 @@
> > struct inode *inode;
> > loff_t pos;
> >
> >- if (unlikely(count > file->f_maxcount))
> >+ if (unlikely(count > INT_MAX))
> > goto Einval;
> > pos = *ppos;
> > if (unlikely((pos < 0) || (loff_t) (pos + count) < 0))
> >
>
> And depending upon how you feel about read(2) and write(2) returning larger
> than can be represented by a ssize_t, you can get rid of this test too and
> apply the attached patch to prevent failures occuring in the direct-io
> subsystem.
>
> Limiting i/o requests to INT_MAX is starting to seem a little small.
>
> Thanx...
>
> ps
>
> Signed-off-by: Peter Staubach <staubach@redhat.com>
>
[snip]
> + if (niov)
> + kfree(niov);
Just make this simply
kfree(niov);
kfree() makes the check for NULL itself internally, no need to do it twice.
--
Jesper Juhl <jesper.juhl@gmail.com>
Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please http://www.expita.com/nomime.html
next prev parent reply other threads:[~2005-08-22 21:57 UTC|newest]
Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-08-19 11:33 2.6.13-rc6-mm1 Andrew Morton
2005-08-19 13:12 ` 2.6.13-rc6-mm1 Brice Goglin
2005-08-19 13:18 ` 2.6.13-rc6-mm1 Brice Goglin
2005-08-19 13:22 ` 2.6.13-rc6-mm1 Brice Goglin
2005-08-19 13:21 ` 2.6.13-rc6-mm1 Reuben Farrelly
2005-08-19 17:34 ` 2.6.13-rc6-mm1 Andrew Morton
2005-08-20 1:27 ` 2.6.13-rc6-mm1 Reuben Farrelly
2005-08-20 1:34 ` 2.6.13-rc6-mm1 Andrew Morton
2005-08-20 1:36 ` 2.6.13-rc6-mm1 Andrew Morton
2005-08-20 13:40 ` 2.6.13-rc6-mm1 David Woodhouse
2005-08-21 6:25 ` 2.6.13-rc6-mm1 Reuben Farrelly
2005-08-19 13:25 ` 2.6.13-rc6-mm1 Brice Goglin
2005-08-19 13:27 ` 2.6.13-rc6-mm1 Russell King
2005-08-19 13:41 ` 2.6.13-rc6-mm1 Brice Goglin
2005-08-19 13:45 ` 2.6.13-rc6-mm1 Russell King
2005-08-19 14:05 ` 2.6.13-rc6-mm1 Brice Goglin
2005-08-19 15:02 ` 2.6.13-rc6-mm1: drivers/net/s2io.c: compile error with gcc 4.0 Adrian Bunk
2005-08-19 15:20 ` [PATCH] mips: add pcibios_select_root Yoichi Yuasa
2005-08-19 15:45 ` 2.6.13-rc6-mm1 Ed Tomlinson
2005-08-19 16:04 ` 2.6.13-rc6-mm1 Benoit Boissinot
2005-08-19 21:01 ` 2.6.13-rc6-mm1 Ed Tomlinson
2005-08-19 21:24 ` 2.6.13-rc6-mm1 Benoit Boissinot
2005-08-19 16:11 ` 2.6.13-rc6-mm1 Dave Kleikamp
2005-08-19 19:21 ` 2.6.13-rc6-mm1 Andrew Morton
2005-08-19 21:27 ` [RFC] f_maxcount seems to be deprecated ? Eric Dumazet
2005-08-19 21:33 ` Andrew Morton
2005-08-19 22:01 ` [PATCH] Suppress deprecated f_maxcount in 'struct file' Eric Dumazet
2005-08-22 13:08 ` Peter Staubach
2005-08-22 21:57 ` Jesper Juhl [this message]
2005-08-19 16:40 ` 2.6.13-rc6-mm1: drivers/scsi/aic7xxx/ compile error Adrian Bunk
2005-08-19 16:42 ` Christoph Hellwig
2005-08-19 16:42 ` 2.6.13-rc6-mm1 Avuton Olrich
2005-08-19 21:10 ` 2.6.13-rc6-mm1 Greg KH
2005-08-19 21:21 ` 2.6.13-rc6-mm1 Avuton Olrich
2005-08-19 17:28 ` 2.6.13-rc6-mm1: too many 'ipv4_table' variables Adrian Bunk
2005-08-19 18:03 ` 2.6.13-rc6-mm1 Jesper Juhl
2005-08-20 1:00 ` [PATCH] fix warning of TANBAC_TB0219 in drivers/char/Kconfig Yoichi Yuasa
2005-08-19 19:22 ` 2.6.13-rc6-mm1 hallyn
2005-08-19 19:51 ` 2.6.13-rc6-mm1 - OOPS in drivers/net/phy Marc Ballarin
2005-08-19 20:34 ` 2.6.13-rc6-mm1: remove-asm-hdregh.patch problems Adrian Bunk
2005-08-19 20:37 ` Andrew Morton
2005-08-19 22:49 ` 2.6.13-rc6-mm1 broke parallel port printer Adrian Bunk
2005-08-19 23:36 ` [-mm patch] drivers/cdrom/sbpcd.c: fix the compilation Adrian Bunk
2005-08-19 23:45 ` Nish Aravamudan
2005-08-20 0:20 ` 2.6.13-rc6-mm1: why is PHYLIB a user-visible option? Adrian Bunk
2005-08-20 0:29 ` Jeff Garzik
2005-08-20 14:49 ` 2.6.13-rc6-mm1 Martin J. Bligh
2005-08-20 15:43 ` 2.6.13-rc6-mm1 [i6300escb.c 2 bugs, little cleanup] Jiri Slaby
2005-08-20 17:36 ` 2.6.13-rc6-mm1: git-ocfs2.patch breaks jffs Adrian Bunk
2005-08-20 19:03 ` [-mm patch] net/core/sysctl_net_core.c: fix PROC_FS=n compile Adrian Bunk
2005-08-21 0:14 ` David S. Miller
2005-08-21 15:08 ` 2.6.13-rc6-mm1 Martin J. Bligh
2005-08-21 16:30 ` 2.6.13-rc6-mm1 Benoit Boissinot
2005-08-21 17:40 ` 2.6.13-rc6-mm1 Jon Smirl
2005-08-21 21:44 ` 2.6.13-rc6-mm1 Benoit Boissinot
2005-08-21 22:11 ` 2.6.13-rc6-mm1 Jon Smirl
2005-08-22 1:36 ` 2.6.13-rc6-mm1 Rogério Brito
[not found] ` <20050822011528.GA12602@ime.usp.br>
2005-08-22 3:48 ` 2.6.13-rc6-mm1 Andrew Morton
2005-08-22 13:30 ` 2.6.13-rc6-mm1 Rogério Brito
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=9a87484905082214573a50c58b@mail.gmail.com \
--to=jesper.juhl@gmail.com \
--cc=akpm@osdl.org \
--cc=dada1@cosmosbay.com \
--cc=linux-kernel@vger.kernel.org \
--cc=staubach@redhat.com \
/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