summaryrefslogtreecommitdiffstats
path: root/fs
Commit message (Collapse)AuthorAgeFilesLines
* Switch to a valid email address...Alan Cox2008-10-274-4/+4
| | | | | Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* epoll: avoid double-inserts in case of EFAULTDavide Libenzi2008-10-261-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | In commit f337b9c58332bdecde965b436e47ea4c94d30da0 ("epoll: drop unnecessary test") Thomas found that there is an unnecessary (always true) test in ep_send_events(). The callback never inserts into ->rdllink while the send loop is performed, and also does the ~EP_PRIVATE_BITS test. Given we're holding the mutex during this time, the conditions tested inside the loop are always true. HOWEVER. The test "!ep_is_linked(&epi->rdllink)" wasn't there because we insert into ->rdllink, but because the send-events loop might terminate before the whole list is scanned (-EFAULT). In such cases, when the loop terminates early, and when a (leftover) file received an event while we're performing the lockless loop, we need such test to avoid to double insert the epoll items. The list_splice() done a few steps below, will correctly re-insert the ones that were left on "txlist". This should fix the kenrel.org bugzilla entry 11831. Signed-off-by: Davide Libenzi <davidel@xmailserver.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* select: deal with math overflow from borderline valid userland dataArjan van de Ven2008-10-262-4/+6
| | | | | | | | | | | | | | | | | | | | Some userland apps seem to pass in a "0" for the seconds, and several seconds worth of usecs to select(). The old kernels accepted this just fine, so the new kernels must too. However, due to the upscaling of the microseconds to nanoseconds we had some cases where we got math overflow, and depending on the GCC version (due to inlining decisions) that actually resulted in an -EINVAL return. This patch fixes this by adding the excess microseconds to the seconds field. Also with thanks to Marcin Slusarz for spotting some implementation bugs in the diagnostics patches. Reported-by: Carlos R. Mafra <crmafra2@gmail.com> Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* ext4: Fix duplicate entries returned from getdents() system callTheodore Ts'o2008-10-251-12/+8
| | | | | | | | | | | | | | | | | | | Fix a regression caused by commit d0156417, "ext4: fix ext4_dx_readdir hash collision handling", where deleting files in a large directory (requiring more than one getdents system call), results in some filenames being returned twice. This was caused by a failure to update info->curr_hash and info->curr_minor_hash, so that if the directory had gotten modified since the last getdents() system call (as would be the case if the user is running "rm -r" or "git clean"), a directory entry would get returned twice to the userspace. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> This patch fixes the bug reported by Markus Trippelsdorf at: http://bugzilla.kernel.org/show_bug.cgi?id=11844 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> Tested-by: Markus Trippelsdorf <markus@trippelsdorf.de>
* ext3: Fix duplicate entries returned from getdents() system callTheodore Ts'o2008-10-251-12/+8
| | | | | | | | | | | | | | | | | Fix a regression caused by commit 6a897cf4, "ext3: fix ext3_dx_readdir hash collision handling", where deleting files in a large directory (requiring more than one getdents system call), results in some filenames being returned twice. This was caused by a failure to update info->curr_hash and info->curr_minor_hash, so that if the directory had gotten modified since the last getdents() system call (as would be the case if the user is running "rm -r" or "git clean"), a directory entry would get returned twice to the userspace. This patch fixes the bug reported by Markus Trippelsdorf at: http://bugzilla.kernel.org/show_bug.cgi?id=11844 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> Tested-by: Markus Trippelsdorf <markus@trippelsdorf.de>
* Merge branch 'proc' of ↵Linus Torvalds2008-10-2324-965/+895
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/adobriyan/proc * 'proc' of git://git.kernel.org/pub/scm/linux/kernel/git/adobriyan/proc: (35 commits) proc: remove fs/proc/proc_misc.c proc: move /proc/vmcore creation to fs/proc/vmcore.c proc: move pagecount stuff to fs/proc/page.c proc: move all /proc/kcore stuff to fs/proc/kcore.c proc: move /proc/schedstat boilerplate to kernel/sched_stats.h proc: move /proc/modules boilerplate to kernel/module.c proc: move /proc/diskstats boilerplate to block/genhd.c proc: move /proc/zoneinfo boilerplate to mm/vmstat.c proc: move /proc/vmstat boilerplate to mm/vmstat.c proc: move /proc/pagetypeinfo boilerplate to mm/vmstat.c proc: move /proc/buddyinfo boilerplate to mm/vmstat.c proc: move /proc/vmallocinfo to mm/vmalloc.c proc: move /proc/slabinfo boilerplate to mm/slub.c, mm/slab.c proc: move /proc/slab_allocators boilerplate to mm/slab.c proc: move /proc/interrupts boilerplate code to fs/proc/interrupts.c proc: move /proc/stat to fs/proc/stat.c proc: move rest of /proc/partitions code to block/genhd.c proc: move /proc/cpuinfo code to fs/proc/cpuinfo.c proc: move /proc/devices code to fs/proc/devices.c proc: move rest of /proc/locks to fs/locks.c ...
| * proc: remove fs/proc/proc_misc.cAlexey Dobriyan2008-10-233-67/+2
| | | | | | | | | | | | | | Now that everything was moved to their more or less expected places, apply rm(1). Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
| * proc: move /proc/vmcore creation to fs/proc/vmcore.cAlexey Dobriyan2008-10-232-6/+3
| | | | | | | | Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
| * proc: move pagecount stuff to fs/proc/page.cAlexey Dobriyan2008-10-233-135/+148
| | | | | | | | Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
| * proc: move all /proc/kcore stuff to fs/proc/kcore.cAlexey Dobriyan2008-10-232-9/+13
| | | | | | | | Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
| * proc: move /proc/schedstat boilerplate to kernel/sched_stats.hAlexey Dobriyan2008-10-231-3/+0
| | | | | | | | Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
| * proc: move /proc/modules boilerplate to kernel/module.cAlexey Dobriyan2008-10-231-17/+0
| | | | | | | | Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
| * proc: move /proc/diskstats boilerplate to block/genhd.cAlexey Dobriyan2008-10-231-16/+0
| | | | | | | | | | Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Acked-by: Jens Axboe <jens.axboe@oracle.com>
| * proc: move /proc/zoneinfo boilerplate to mm/vmstat.cAlexey Dobriyan2008-10-231-13/+0
| | | | | | | | | | Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Acked-by: Christoph Lameter <cl@linux-foundation.org>
| * proc: move /proc/vmstat boilerplate to mm/vmstat.cAlexey Dobriyan2008-10-231-12/+0
| | | | | | | | | | Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Acked-by: Christoph Lameter <cl@linux-foundation.org>
| * proc: move /proc/pagetypeinfo boilerplate to mm/vmstat.cAlexey Dobriyan2008-10-231-13/+0
| | | | | | | | Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
| * proc: move /proc/buddyinfo boilerplate to mm/vmstat.cAlexey Dobriyan2008-10-231-14/+0
| | | | | | | | Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
| * proc: move /proc/vmallocinfo to mm/vmalloc.cAlexey Dobriyan2008-10-231-28/+0
| | | | | | | | | | Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Acked-by: Christoph Lameter <cl@linux-foundation.org>
| * proc: move /proc/slabinfo boilerplate to mm/slub.c, mm/slab.cAlexey Dobriyan2008-10-231-17/+0
| | | | | | | | | | | | | | Lose dummy ->write hook in case of SLUB, it's possible now. Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Acked-by: Pekka Enberg <penberg@cs.helsinki.fi>
| * proc: move /proc/slab_allocators boilerplate to mm/slab.cAlexey Dobriyan2008-10-231-30/+0
| | | | | | | | | | Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Acked-by: Pekka Enberg <penberg@cs.helsinki.fi>
| * proc: move /proc/interrupts boilerplate code to fs/proc/interrupts.cAlexey Dobriyan2008-10-233-40/+54
| | | | | | | | Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
| * proc: move /proc/stat to fs/proc/stat.cAlexey Dobriyan2008-10-233-134/+154
| | | | | | | | Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
| * proc: move rest of /proc/partitions code to block/genhd.cAlexey Dobriyan2008-10-231-14/+0
| | | | | | | | | | Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Acked-by: Jens Axboe <jens.axboe@oracle.com>
| * proc: move /proc/cpuinfo code to fs/proc/cpuinfo.cAlexey Dobriyan2008-10-233-14/+25
| | | | | | | | Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
| * proc: move /proc/devices code to fs/proc/devices.cAlexey Dobriyan2008-10-233-60/+71
| | | | | | | | Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
| * proc: move rest of /proc/locks to fs/locks.cAlexey Dobriyan2008-10-232-18/+21
| | | | | | | | Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
| * proc: move /proc/kmsg creation to fs/proc/kmsg.cAlexey Dobriyan2008-10-233-7/+9
| | | | | | | | Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
| * proc: remove remnants of ->read_proc in proc_misc.cAlexey Dobriyan2008-10-231-27/+0
| | | | | | | | Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
| * proc: move /proc/execdomains to kernel/exec_domain.cAlexey Dobriyan2008-10-231-9/+0
| | | | | | | | Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
| * proc: switch /proc/cmdline to seq_fileAlexey Dobriyan2008-10-233-10/+30
| | | | | | | | | | | | and move it to fs/proc/cmdline.c while I'm at it. Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
| * proc: move /proc/filesystems to fs/filesystems.cAlexey Dobriyan2008-10-232-8/+39
| | | | | | | | Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
| * proc: move /proc/stram to m68k-specific codeAlexey Dobriyan2008-10-231-13/+0
| | | | | | | | Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
| * proc: move /proc/hardware to m68k-specific codeAlexey Dobriyan2008-10-231-13/+0
| | | | | | | | Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
| * proc: switch /proc/version to seq_fileAlexey Dobriyan2008-10-233-13/+35
| | | | | | | | | | | | and move it to fs/proc/version.c while I'm at it. Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
| * proc: switch /proc/meminfo to seq_fileAlexey Dobriyan2008-10-233-137/+169
| | | | | | | | | | | | and move it to fs/proc/meminfo.c while I'm at it. Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
| * proc: switch /proc/uptime to seq_fileAlexey Dobriyan2008-10-233-21/+44
| | | | | | | | | | | | and move it to fs/proc/uptime.c while I'm at it. Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
| * proc: switch /proc/loadavg to seq_fileAlexey Dobriyan2008-10-233-27/+52
| | | | | | | | | | | | and move it to fs/proc/loadavg.c while I'm at it. Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
| * proc: use WARN() rather than printk+backtraceArjan van de Ven2008-10-231-2/+1
| | | | | | | | | | | | | | | | | | | | Use WARN() rather than a printk() + backtrace(); this gives a more standard format message as well as complete information (including line numbers etc) that will be collected by kerneloops.org Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
| * proc: spread __initAlexey Dobriyan2008-10-232-3/+4
| | | | | | | | Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
| * proc: proc_init_inodecache() can't failAlexey Dobriyan2008-10-233-6/+5
| | | | | | | | | | | | kmem_cache creation code will panic, don't return anything. Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
| * proc: fix vma display mismatch between /proc/pid/{maps,smaps}Joe Korty2008-10-231-9/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 4752c369789250eafcd7813e11c8fb689235b0d2 aka "maps4: simplify interdependence of maps and smaps" broke /proc/pid/smaps, causing it to display some vmas twice and other vmas not at all. For example: grep .- /proc/1/smaps >/tmp/smaps; diff /proc/1/maps /tmp/smaps 1 25d24 2 < 7fd7e23aa000-7fd7e23ac000 rw-p 7fd7e23aa000 00:00 0 3 28a28 4 > ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall] The bug has something to do with setting m->version before all the seq_printf's have been performed. show_map was doing this correctly, but show_smap was doing this in the middle of its seq_printf sequence. This patch arranges things so that the setting of m->version in show_smap is also done at the end of its seq_printf sequence. Testing: in addition to the above grep test, for each process I summed up the 'Rss' fields of /proc/pid/smaps and compared that to the 'VmRSS' field of /proc/pid/status. All matched except for Xorg (which has a /dev/mem mapping which Rss accounts for but VmRSS does not). This result gives us some confidence that neither /proc/pid/maps nor /proc/pid/smaps are any longer skipping or double-counting vmas. Signed-off-by: Joe Korty <joe.korty@ccur.com> Cc: Matt Mackall <mpm@selenic.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
* | ext4: remove unused variable in ext4_get_parentChristoph Hellwig2008-10-231-1/+0
| | | | | | | | | | | | | | Signed-off-by: Christoph Hellwig <hch@lst.de> [ All users removed in "switch all filesystems over to d_obtain_alias", aka commit 440037287c5ebb07033ab927ca16bb68c291d309 ] Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* | ext3 quota support: fix compile failureLinus Torvalds2008-10-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | This one was due to a merge error: we added a use of nd.path in commit 2d7c820e56ce83b23daee9eb5343730fb309418e ("ext3: add checks for errors from jbd"), and concurrently we got rid of 'nd' and used a naked 'path' in commit 8264613def2e5c4f12bc3167713090fd172e6055 ("[PATCH] switch quota_on-related stuff to kern_path()"). That all merged cleanly, but it didn't actually _work_. This should fix it. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* | Merge branch 'v28-range-hrtimers-for-linus-v2' of ↵Linus Torvalds2008-10-233-294/+297
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip * 'v28-range-hrtimers-for-linus-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (37 commits) hrtimers: add missing docbook comments to struct hrtimer hrtimers: simplify hrtimer_peek_ahead_timers() hrtimers: fix docbook comments DECLARE_PER_CPU needs linux/percpu.h hrtimers: fix typo rangetimers: fix the bug reported by Ingo for real rangetimer: fix BUG_ON reported by Ingo rangetimer: fix x86 build failure for the !HRTIMERS case select: fix alpha OSF wrapper select: fix alpha OSF wrapper hrtimer: peek at the timer queue just before going idle hrtimer: make the futex() system call use the per process slack value hrtimer: make the nanosleep() syscall use the per process slack hrtimer: fix signed/unsigned bug in slack estimator hrtimer: show the timer ranges in /proc/timer_list hrtimer: incorporate feedback from Peter Zijlstra hrtimer: add a hrtimer_start_range() function hrtimer: another build fix hrtimer: fix build bug found by Ingo hrtimer: make select() and poll() use the hrtimer range feature ...
| * \ Merge branch 'timers/range-hrtimers' into v28-range-hrtimers-for-linus-v2Thomas Gleixner2008-10-223-294/+297
| |\ \ | | |/ | |/| | | | | | | | | | | | | | | | Conflicts: kernel/time/tick-sched.c Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
| | * Merge commit 'linus/master' into merge-linusArjan van de Ven2008-10-17271-6903/+14647
| | |\ | | | | | | | | | | | | | | | | | | | | Conflicts: arch/x86/kvm/i8254.c
| | * | hrtimer: fix signed/unsigned bug in slack estimatorArjan van de Ven2008-09-071-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the slack estimator used unsigned math; however for very short delay it's possible that by the time you calculate the timeout, it's already passed and you get a negative time/slack... in an unsigned variable... which then gets turned into a 100 msec delay rather than zero. This patch fixes this by using a signed typee in the right places. Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
| | * | hrtimer: incorporate feedback from Peter ZijlstraArjan van de Ven2008-09-071-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (based on lkml review) * use rt_task() * task_nice() has a sign Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
| | * | hrtimer: make select() and poll() use the hrtimer range featureArjan van de Ven2008-09-051-2/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch makes the select() and poll() hrtimers use the new range feature and settings from the task struct. In addition, this includes the estimate_accuracy() function that Linus posted to lkml, but changed entirely based on other peoples lkml feedback. Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
| | * | hrtimer: convert timerfd to the new hrtimer apisArjan van de Ven2008-09-051-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to be able to do range hrtimers we need to use accessor functions to the "expire" member of the hrtimer struct. This patch converts timerfd to these accessors. Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>