1. 26 6月, 2006 40 次提交
    • A
      [PATCH] Fix "biovec-(256)" in /proc/slabinfo · d84a8477
      Alexey Dobriyan 提交于
      Stringify does what it was told to do.
      Signed-off-by: NAlexey Dobriyan <adobriyan@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      d84a8477
    • K
      [PATCH] pacct: none-delayed process accounting accumulation · 77787bfb
      KaiGai Kohei 提交于
      In current 2.6.17 implementation, signal_struct refered from task_struct is
      used for per-process data structure.  The pacct facility also uses it as a
      per-process data structure to store stime, utime, minflt, majflt.  But those
      members are saved in __exit_signal().  It's too late.
      
      For example, if some threads exits at same time, pacct facility has a
      possibility to drop accountings for a part of those threads.  (see, the
      following 'The results of original 2.6.17 kernel') I think accounting
      information should be completely collected into the per-process data structure
      before writing out an accounting record.
      
      This patch fixes this matter.  Accumulation of stime, utime, minflt and majflt
      are done before generating accounting record.
      
      [mingo@elte.hu: fix acct_collect() siglock bug found by lockdep]
      Signed-off-by: NKaiGai Kohei <kaigai@ak.jp.nec.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      77787bfb
    • K
      [PATCH] pacct: avoidance to refer the last thread as a representation of the process · f6ec29a4
      KaiGai Kohei 提交于
      When pacct facility generate an 'ac_flag' field in accounting record, it
      refers a task_struct of the thread which died last in the process.  But any
      other task_structs are ignored.
      
      Therefore, pacct facility drops ASU flag even if root-privilege operations are
      used by any other threads except the last one.  In addition, AFORK flag is
      always set when the thread of group-leader didn't die last, although this
      process has called execve() after fork().
      
      We have a same matter in ac_exitcode.  The recorded ac_exitcode is an exit
      code of the last thread in the process.  There is a possibility this exitcode
      is not the group leader's one.
      f6ec29a4
    • K
      [PATCH] pacct: add pacct_struct to fix some pacct bugs. · 0e464814
      KaiGai Kohei 提交于
      The pacct facility need an i/o operation when an accounting record is
      generated.  There is a possibility to wake OOM killer up.  If OOM killer is
      activated, it kills some processes to make them release process memory
      regions.
      
      But acct_process() is called in the killed processes context before calling
      exit_mm(), so those processes cannot release own memory.  In the results, any
      processes stop in this point and it finally cause a system stall.
      0e464814
    • P
      [PATCH] synclink_gt: add GT2 adapter support · 6f84be84
      Paul Fulghum 提交于
      Add support for SyncLink GT2 adapter to driver.
      Signed-off-by: NPaul Fulghum <paulkf@microgate.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      6f84be84
    • P
      [PATCH] add synclink_gt custom hdlc idle · 643f3319
      Paul Fulghum 提交于
      Add custom HDLC idle pattern feature.
      
      It allows the user to specify an arbitrary 8 or 16 bit repeating pattern on
      the transmit data pin between HDLC frames.
      
      In most cases the idle pattern is continuous ones or flags as supported by off
      the shelf synchronous controllers and defined in the ISO3309 standard.  Some
      applications (radio/satellite modems, connections to legacy military hardware)
      require non-standard patterns.
      Signed-off-by: NPaul Fulghum <paulkf@microgate.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      643f3319
    • R
      [PATCH] kthread: move kernel-doc and put it into DocBook · 9e37bd30
      Randy Dunlap 提交于
      Move kthread API kernel-doc from kthread.h to kthread.c & fix it.
      Add kthread API to kernel-api DocBook.
      Signed-off-by: NRandy Dunlap <rdunlap@xenotime.net>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      9e37bd30
    • J
      [PATCH] Implement kasprintf · e905914f
      Jeremy Fitzhardinge 提交于
      Implement kasprintf, a kernel version of asprintf.  This allocates the
      memory required for the formatted string, including the trailing '\0'.
      Returns NULL on allocation failure.
      Signed-off-by: NJeremy Fitzhardinge <jeremy@xensource.com>
      Signed-off-by: NChris Wright <chrisw@sous-sol.org>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      e905914f
    • R
      [PATCH] ktime/hrtimer: fix kernel-doc comments · fa9799e3
      Randy Dunlap 提交于
      Fix kernel-doc formatting in ktime.h and hrtimer.[ch] files.
      Signed-off-by: NRandy Dunlap <rdunlap@xenotime.net>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      fa9799e3
    • U
      [PATCH] Implement AT_SYMLINK_FOLLOW flag for linkat · 45c9b11a
      Ulrich Drepper 提交于
      When the linkat() syscall was added the flag parameter was added in the
      last minute but it wasn't used so far.  The following patch should change
      that.  My tests show that this is all that's needed.
      
      If OLDNAME is a symlink setting the flag causes linkat to follow the
      symlink and create a hardlink with the target.  This is actually the
      behavior POSIX demands for link() as well but Linux wisely does not do
      this.  With this flag (which will most likely be in the next POSIX
      revision) the programmer can choose the behavior, defaulting to the safe
      variant.  As a side effect it is now possible to implement a
      POSIX-compliant link(2) function for those who are interested.
      
        touch file
        ln -s file symlink
      
        linkat(fd, "symlink", fd, "newlink", 0)
          -> newlink is hardlink of symlink
      
        linkat(fd, "symlink", fd, "newlink", AT_SYMLINK_FOLLOW)
          -> newlink is hardlink of file
      
      The value of AT_SYMLINK_FOLLOW is determined by the definition we already
      use in glibc.
      Signed-off-by: NUlrich Drepper <drepper@redhat.com>
      Acked-by: NAl Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      45c9b11a
    • S
      [PATCH] kthread: update loop.c to use kthread · c7b2eff0
      Serge E. Hallyn 提交于
      Update loop.c to use a kthread instead of a deprecated kernel_thread for
      loop devices.
      
      [akpm@osdl.org: don't change the thread's name]
      Signed-off-by: NSerge E. Hallyn <serue@us.ibm.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      c7b2eff0
    • M
      [PATCH] fuse: add request interruption · a4d27e75
      Miklos Szeredi 提交于
      Add synchronous request interruption.  This is needed for file locking
      operations which have to be interruptible.  However filesystem may implement
      interruptibility of other operations (e.g.  like NFS 'intr' mount option).
      Signed-off-by: NMiklos Szeredi <miklos@szeredi.hu>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      a4d27e75
    • M
      [PATCH] fuse: add POSIX file locking support · 71421259
      Miklos Szeredi 提交于
      This patch adds POSIX file locking support to the fuse interface.
      
      This implementation doesn't keep any locking state in kernel.  Unlocking on
      close() is handled by the FLUSH message, which now contains the lock owner id.
      
      Mandatory locking is not supported.  The filesystem may enfoce mandatory
      locking in userspace if needed.
      Signed-off-by: NMiklos Szeredi <miklos@szeredi.hu>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      71421259
    • J
      [PATCH] fuse: use MISC_MAJOR · 3e8c54fa
      Jan Engelhardt 提交于
      The following patches add POSIX file locking to the fuse interface.
      
      Additional changes ralated to this are:
      
        - asynchronous interrupt of requests by SIGKILL no longer supported
      
        - separate control filesystem, instead of using sysfs objects
      
        - add support for synchronously interrupting requests
      
      Details are documented in Documentation/filesystems/fuse.txt throughout the
      patches.
      
      This patch:
      
      Have fuse.h use MISC_MAJOR rather than a hardcoded '10'.
      Signed-off-by: NJan Engelhardt <jengelh@gmx.de>
      Signed-off-by: NMiklos Szeredi <miklos@szeredi.hu>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      3e8c54fa
    • A
      [PATCH] N32 sigset and __COMPAT_ENDIAN_SWAP__ · 838cd153
      akpm@osdl.org 提交于
      I'm testing glibc on MIPS64, little-endian, N32, O32 and N64 multilibs.
      
      Among the NPTL test failures seen are some arising from sigsuspend problems
      for N32: it blocks the wrong signals, so SIGCANCEL (SIGRTMIN) is blocked
      despite glibc's carefully excluding it from sets of signals to block.
      Specifically, testing suggests it blocks signal N^32 instead of signal N,
      so (in the example tested) blocking SIGUSR1 (17) blocks signal 49 instead.
      
      glibc's sigset_t uses an array of unsigned long, as does the kernel.
      In both cases, signal N+1 is represented as
      (1UL << (N % (8 * sizeof (unsigned long)))) in word number
      (N / (8 * sizeof (unsigned long))).
      
      Thus the N32 glibc uses an array of 32-bit words and the N64 kernel uses an
      array of 64-bit words.  For little-endian, the layout is the same, with
      signals 1-32 in the first 4 bytes, signals 33-64 in the second, etc.; for
      big-endian, userspace has that layout while in the kernel each 8 bytes have
      the two halves swapped from the userspace layout.
      
      The N32 sigsuspend syscall uses sigset_from_compat to convert the userspace
      sigset to kernel format.  If __COMPAT_ENDIAN_SWAP__ is *not* set, this uses
      logic of the form
      
        set->sig[0] = compat->sig[0] | (((long)compat->sig[1]) << 32 )
      
      to convert the userspace sigset to a kernel one.  This looks correct to me
      for both big and little endian, given that in userspace compat->sig[1] will
      represent signals 33-64, and so will the high 32 bits of set->sig[0] in the
      kernel.  If however __COMPAT_ENDIAN_SWAP__ *is* set, as it is for
      __MIPSEL__, it uses
      
        set->sig[0] = compat->sig[1] | (((long)compat->sig[0]) << 32 );
      
      which seems incorrect for both big and little endian, and would
      explain the observed symptoms.
      
      This code is the only use of __COMPAT_ENDIAN_SWAP__, so if incorrect
      then that macro serves no purpose, in which case something like the
      following patch would seem appropriate to remove it.
      Signed-off-by: NJoseph Myers <joseph@codesourcery.com>
      Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      838cd153
    • S
      [PATCH] Get rid of /proc/sys/proc · eab03ac7
      Stephen Hemminger 提交于
      The table is empty, why does it still exist?
      Signed-off-by: NStephen Hemminger <shemminger@osdl.org>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      eab03ac7
    • A
      [PATCH] RTC: Add rtc_year_days() to calculate tm_yday · 8232212e
      Andrew Victor 提交于
      RTC: Add exported function rtc_year_days() to calculate the tm_yday value.
      Signed-off-by: NAndrew Victor <andrew@sanpeople.com>
      Signed-off-by: NAlessandro Zummo <a.zummo@towertech.it>
      Cc: Russell King <rmk@arm.linux.org.uk>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      8232212e
    • R
      [PATCH] Add v3020 RTC support · 362600fe
      Raphael Assenat 提交于
      This patch adds support for the v3020 RTC from EM Microelectronic.
      
      The v3020 RTC is designed to be connected on a bus using only one data bit.
       Since any data bit may be used, it is necessary to specify this to the
      driver by passing a struct v3020_platform_data pointer (see
      include/linux/rtc-v3020.h) to the driver.
      
      Part of the following code comes from the kernel patchs produced by
      Compulab for their products.  The original file (available here:
      http://raph.people.8d.com/misc/emv3020.c) was released under the terms of
      the GPL license.
      
      [akpm@osdl.org: cleanups]
      Signed-off-by: NRaphael Assenat <raph@raphnet.net>
      Cc: Alessandro Zummo <a.zummo@towertech.it>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      362600fe
    • A
      [PATCH] rtc subsystem: add capability checks · 110d693d
      Alessandro Zummo 提交于
      Centralize CAP_SYS_XXX checks to avoid duplicate code and missing checks in
      the drivers.
      Signed-off-by: NAlessandro Zummo <a.zummo@towertech.it>
      Cc: Richard Purdie <rpurdie@rpsys.net>
      Cc: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      110d693d
    • A
      [PATCH] RTC: rtc-dev UIE emulation · 655066c3
      Atsushi Nemoto 提交于
      Import genrtc's RTC UIE emulation (CONFIG_GEN_RTC_X) to rtc-dev driver with
      slight adjustments/refinements.  This makes UIE-less rtc drivers work
      better with programs doing read/poll on /dev/rtc, such as hwclock.  This
      emulation should not harm rtc drivers with UIE support, since
      rtc_dev_ioctl() calls underlaying rtc driver's ioctl() first.
      Signed-off-by: NAtsushi Nemoto <anemo@mba.ocn.ne.jp>
      Acked-by: NAlessandro Zummo <a.zummo@towertech.it>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      655066c3
    • D
      [PATCH] epoll: use unlocked wqueue operations · 3419b23a
      Davide Libenzi 提交于
      A few days ago Arjan signaled a lockdep red flag on epoll locks, and
      precisely between the epoll's device structure lock (->lock) and the wait
      queue head lock (->lock).
      
      Like I explained in another email, and directly to Arjan, this can't happen
      in reality because of the explicit check at eventpoll.c:592, that does not
      allow to drop an epoll fd inside the same epoll fd.  Since lockdep is
      working on per-structure locks, it will never be able to know of policies
      enforced in other parts of the code.
      
      It was decided time ago of having the ability to drop epoll fds inside
      other epoll fds, that triggers a very trick wakeup operations (due to
      possibly reentrant callback-driven wakeups) handled by the
      ep_poll_safewake() function.  While looking again at the code though, I
      noticed that all the operations done on the epoll's main structure wait
      queue head (->wq) are already protected by the epoll lock (->lock), so that
      locked-style functions can be used to manipulate the ->wq member.  This
      makes both a lock-acquire save, and lockdep happy.
      
      Running totalmess on my dual opteron for a while did not reveal any problem
      so far:
      
      http://www.xmailserver.org/totalmess.cSigned-off-by: NDavide Libenzi <davidel@xmailserver.org>
      Cc: Arjan van de Ven <arjan@linux.intel.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      3419b23a
    • A
      [PATCH] nbd: endian annotations · 4ad3bcf3
      Alexey Dobriyan 提交于
      Signed-off-by: NAlexey Dobriyan <adobriyan@gmail.com>
      Cc: Paul Clements <Paul.Clements@steeleye.com>
      Cc: Jens Axboe <axboe@suse.de>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      4ad3bcf3
    • A
      [PATCH] for_each_cpu_mask() warning fix · 9de9adb6
      Andrew Morton 提交于
      On UP, this:
      
             cpumask_t mask = node_to_cpumask(numa_node_id());
      
             for_each_cpu_mask(cpu, mask)
      
      does this:
      
      mm/readahead.c: In function `node_readahead_aging':
      mm/readahead.c:850: warning: unused variable `mask'
      
      which is unpleasantly fixed by this:
      Acked-by: NPaul Jackson <pj@sgi.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      9de9adb6
    • I
      [PATCH] introduce WARN_ON_ONCE(cond) · 74bb6a09
      Ingo Molnar 提交于
      Add WARN_ON_ONCE(cond) to print once-per-bootup messages.
      
      [rostedt@goodmis.org: improve code generation]
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NArjan van de Ven <arjan@linux.intel.com>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      74bb6a09
    • M
      [PATCH] ext3_fsblk_t: the rest of in-kernel filesystem blocks conversion · 43d23f90
      Mingming Cao 提交于
      Convert the ext3 in-kernel filesystem blocks to ext3_fsblk_t.  Convert the
      rest of all unsigned long type in-kernel filesystem blocks to ext3_fsblk_t,
      and replace the printk format string respondingly.
      Signed-off-by: NMingming Cao <cmm@us.ibm.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      43d23f90
    • M
      [PATCH] ext3_fsblk_t: filesystem, group blocks and bug fixes · 1c2bf374
      Mingming Cao 提交于
      Some of the in-kernel ext3 block variable type are treated as signed 4 bytes
      int type, thus limited ext3 filesystem to 8TB (4kblock size based).  While
      trying to fix them, it seems quite confusing in the ext3 code where some
      blocks are filesystem-wide blocks, some are group relative offsets that need
      to be signed value (as -1 has special meaning).  So it seem saner to define
      two types of physical blocks: one is filesystem wide blocks, another is
      group-relative blocks.  The following patches clarify these two types of
      blocks in the ext3 code, and fix the type bugs which limit current 32 bit ext3
      filesystem limit to 8TB.
      
      With this series of patches and the percpu counter data type changes in the mm
      tree, we are able to extend exts filesystem limit to 16TB.
      
      This work is also a pre-request for the recent >32 bit ext3 work, and makes
      the kernel to able to address 48 bit ext3 block a lot easier: Simply redefine
      ext3_fsblk_t from unsigned long to sector_t and redefine the format string for
      ext3 filesystem block corresponding.
      
      Two RFC with a series patches have been posted to ext2-devel list and have
      been reviewed and discussed:
      http://marc.theaimsgroup.com/?l=ext2-devel&m=114722190816690&w=2
      
      http://marc.theaimsgroup.com/?l=ext2-devel&m=114784919525942&w=2
      
      Patches are tested on both 32 bit machine and 64 bit machine, <8TB ext3 and
      >8TB ext3 filesystem(with the latest to be released e2fsprogs-1.39).  Tests
      includes overnight fsx, tiobench, dbench and fsstress.
      
      This patch:
      
      Defines ext3_fsblk_t and ext3_grpblk_t, and the printk format string for
      filesystem wide blocks.
      
      This patch classifies all block group relative blocks, and ext3_fsblk_t blocks
      occurs in the same function where used to be confusing before.  Also include
      kernel bug fixes for filesystem wide in-kernel block variables.  There are
      some fileystem wide blocks are treated as int/unsigned int type in the kernel
      currently, especially in ext3 block allocation and reservation code.  This
      patch fixed those bugs by converting those variables to ext3_fsblk_t(unsigned
      long) type.
      Signed-off-by: NMingming Cao <cmm@us.ibm.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      1c2bf374
    • B
      [PATCH] AX88796 parallel port driver · ad4063b0
      Ben Dooks 提交于
      Driver for the simple parallel port interface on the Asix AX88796 chip on
      an platform_bus.
      
      [akpm@osdl.org: x86_64 build fix]
      Signed-off-by: NBen Dooks <ben-linux@fluff.org>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      ad4063b0
    • N
      [PATCH] Make copy_from_user_inatomic NOT zero the tail on i386 · 7c12d811
      NeilBrown 提交于
      As described in a previous patch and documented in mm/filemap.h,
      copy_from_user_inatomic* shouldn't zero out the tail of the buffer after an
      incomplete copy.
      
      This patch implements that change for i386.
      
      For the _nocache version, a new __copy_user_intel_nocache is defined similar
      to copy_user_zeroio_intel_nocache, and this is ultimately used for the copy.
      
      For the regular version, __copy_from_user_ll_nozero is defined which uses
      __copy_user and __copy_user_intel - the later needs casts to reposition the
      __user annotations.
      
      If copy_from_user_atomic is given a constant length of 1, 2, or 4, then we do
      still zero the destintion on failure.  This didn't seem worth the effort of
      fixing as the places where it is used really don't care.
      Signed-off-by: NNeil Brown <neilb@suse.de>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: William Lee Irwin III <wli@holomorphy.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      7c12d811
    • N
      [PATCH] Prepare for __copy_from_user_inatomic to not zero missed bytes · 01408c49
      NeilBrown 提交于
      The problem is that when we write to a file, the copy from userspace to
      pagecache is first done with preemption disabled, so if the source address is
      not immediately available the copy fails *and* *zeros* *the* *destination*.
      
      This is a problem because a concurrent read (which admittedly is an odd thing
      to do) might see zeros rather that was there before the write, or what was
      there after, or some mixture of the two (any of these being a reasonable thing
      to see).
      
      If the copy did fail, it will immediately be retried with preemption
      re-enabled so any transient problem with accessing the source won't cause an
      error.
      
      The first copying does not need to zero any uncopied bytes, and doing so
      causes the problem.  It uses copy_from_user_atomic rather than copy_from_user
      so the simple expedient is to change copy_from_user_atomic to *not* zero out
      bytes on failure.
      
      The first of these two patches prepares for the change by fixing two places
      which assume copy_from_user_atomic does zero the tail.  The two usages are
      very similar pieces of code which copy from a userspace iovec into one or more
      page-cache pages.  These are changed to remove the assumption.
      
      The second patch changes __copy_from_user_inatomic* to not zero the tail.
      Once these are accepted, I will look at similar patches of other architectures
      where this is important (ppc, mips and sparc being the ones I can find).
      
      This patch:
      
      There is a problem with __copy_from_user_inatomic zeroing the tail of the
      buffer in the case of an error.  As it is called in atomic context, the error
      may be transient, so it results in zeros being written where maybe they
      shouldn't be.
      
      In the usage in filemap, this opens a window for a well timed read to see data
      (zeros) which is not consistent with any ordering of reads and writes.
      
      Most cases where __copy_from_user_inatomic is called, a failure results in
      __copy_from_user being called immediately.  As long as the latter zeros the
      tail, the former doesn't need to.  However in *copy_from_user_iovec
      implementations (in both filemap and ntfs/file), it is assumed that
      copy_from_user_inatomic will zero the tail.
      
      This patch removes that assumption, so that after this patch it will
      be safe for copy_from_user_inatomic to not zero the tail.
      
      This patch also adds some commentary to filemap.h and asm-i386/uaccess.h.
      
      After this patch, all architectures that might disable preempt when
      kmap_atomic is called need to have their __copy_from_user_inatomic* "fixed".
      This includes
       - powerpc
       - i386
       - mips
       - sparc
      Signed-off-by: NNeil Brown <neilb@suse.de>
      Cc: David Howells <dhowells@redhat.com>
      Cc: Anton Altaparmakov <aia21@cantab.net>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: William Lee Irwin III <wli@holomorphy.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      01408c49
    • A
      [PATCH] IDE CD end-of media error fix · dbe217af
      Alan Cox 提交于
      This is a patch from Alan that fixes a real ide-cd.c regression causing
      bogus "Media Check" failures for perfectly valid Fedora install ISOs, on
      certain CD-ROM drives.
      
      This is a forward port to 2.6.16 (from RHEL) of the minimal changes for the
      end of media problem.  It may not be sufficient for some controllers
      (promise notably) and it does not touch the locking so the error path
      locking is as horked as in mainstream.
      
      From: Ingo Molnar <mingo@elte.hu>
      
      I have ported the patch to 2.6.17-rc4 and tested it by provoking
      end-of-media IO errors with an unaligned ISO image.  Unlike the vanilla
      kernel, the patched kernel interpreted the error condition correctly with
      512 byte granularity:
      
       hdc: command error: status=0x51 { DriveReady SeekComplete Error }
       hdc: command error: error=0x54 { AbortedCommand LastFailedSense=0x05 }
       ide: failed opcode was: unknown
       ATAPI device hdc:
         Error: Illegal request -- (Sense key=0x05)
         Illegal mode for this track or incompatible medium -- (asc=0x64, ascq=0x00)
         The failed "Read 10" packet command was:
         "28 00 00 04 fb 78 00 00 06 00 00 00 00 00 00 00 "
       end_request: I/O error, dev hdc, sector 1306080
       Buffer I/O error on device hdc, logical block 163260
       Buffer I/O error on device hdc, logical block 163261
       Buffer I/O error on device hdc, logical block 163262
      
      the unpatched kernel produces an incorrect error dump:
      
       hdc: command error: status=0x51 { DriveReady SeekComplete Error }
       hdc: command error: error=0x54 { AbortedCommand LastFailedSense=0x05 }
       ide: failed opcode was: unknown
       end_request: I/O error, dev hdc, sector 1306080
       Buffer I/O error on device hdc, logical block 163260
       hdc: command error: status=0x51 { DriveReady SeekComplete Error }
       hdc: command error: error=0x54 { AbortedCommand LastFailedSense=0x05 }
       ide: failed opcode was: unknown
       end_request: I/O error, dev hdc, sector 1306088
       Buffer I/O error on device hdc, logical block 163261
       hdc: command error: status=0x51 { DriveReady SeekComplete Error }
       hdc: command error: error=0x54 { AbortedCommand LastFailedSense=0x05 }
       ide: failed opcode was: unknown
       end_request: I/O error, dev hdc, sector 1306096
       Buffer I/O error on device hdc, logical block 163262
      
      I do not have the right type of CD-ROM drive to reproduce the end-of-media
      data corruption bug myself, but this same patch in RHEL solved it.
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Cc: Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl>
      Cc: Jens Axboe <axboe@suse.de>
      Cc: Matt Mackall <mpm@selenic.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      dbe217af
    • R
      [PATCH] list.h doc: change "counter" to "cursor" · 8e3a67a9
      Randy Dunlap 提交于
      Use loop "cursor" instead of loop "counter" for list iterator descriptions.
      They are not counters, they are pointers or positions.
      Signed-off-by: NRandy Dunlap <rdunlap@xenotime.net>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      8e3a67a9
    • R
      [PATCH] fix list.h kernel-doc · fe96e57d
      Randy Dunlap 提交于
      kernel-doc:
      
      Put all short function descriptions on one line or if they are too long,
      omit the short description & add a Description: section for them.
      
      Change some list iterator descriptions to use "current" point instead of
      "existing" point.
      Signed-off-by: NRandy Dunlap <rdunlap@xenotime.net>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      fe96e57d
    • A
      [PATCH] kernel/sys.c: cleanups · 83cc5ed3
      Adrian Bunk 提交于
      - proper prototypes for the following functions:
        - ctrl_alt_del()  (in include/linux/reboot.h)
        - getrusage()     (in include/linux/resource.h)
      - make the following needlessly global functions static:
        - kernel_restart_prepare()
        - kernel_kexec()
      
      [akpm@osdl.org: compile fix]
      Signed-off-by: NAdrian Bunk <bunk@stusta.de>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      83cc5ed3
    • M
      [PATCH] Make printk work for really early debugging · 76a8ad29
      Michael Ellerman 提交于
      Currently printk is no use for early debugging because it refuses to
      actually print anything to the console unless
      cpu_online(smp_processor_id()) is true.
      
      The stated explanation is that console drivers may require per-cpu
      resources, or otherwise barf, because the system is not yet setup
      correctly.  Fair enough.
      
      However some console drivers might be quite happy running early during
      boot, in fact we have one, and so it'd be nice if printk understood that.
      
      So I added a flag (which I would have called CON_BOOT, but that's taken)
      called CON_ANYTIME, which indicates that a console is happy to be called
      anytime, even if the cpu is not yet online.
      
      Tested on a Power 5 machine, with both a CON_ANYTIME driver and a bogus
      console driver that BUG()s if called while offline.  No problems AFAICT.
      Built for i386 UP & SMP.
      Signed-off-by: NMichael Ellerman <michael@ellerman.id.au>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      76a8ad29
    • A
      [PATCH] fs/ufs/inode.c: make 2 functions static · 138bb68a
      Adrian Bunk 提交于
      Make two needlessly global functions static.
      Signed-off-by: NAdrian Bunk <bunk@stusta.de>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      138bb68a
    • E
      [PATCH] ufs: make fsck -f happy · ee3ffd6c
      Evgeniy Dushistov 提交于
      ufs super block contains some statistic about file systems, like amount of
      directories, free blocks, inodes and so on.
      
      UFS1 hold this information in one location and uses 32bit integers for such
      information, UFS2 hold statistic in another location and uses 64bit integers.
      
      There is transition variant, if UFS1 has type 44BSD and flags field in super
      block has some special value this mean that we work with statistic like UFS2
      does.  and this also means that nobody care about old(UFS1) statistic.
      
      So if start fsck against such file system, after usage linux ufs driver, it
      found error: at now only UFS1 like statistic is updated.
      
      This patch should fix this.  Also it contains some minor cleanup: CodingSytle
      and remove unused variables.
      Signed-off-by: NEvgeniy Dushistov <dushistov@mail.ru>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      ee3ffd6c
    • E
      [PATCH] ufs: one way to access super block · 647b7e87
      Evgeniy Dushistov 提交于
      Super block of UFS usually has size >512, because of fragment size may be 512,
      this cause some problems.
      
      Currently, there are two methods to work with ufs super block:
      
      1) split structure which describes ufs super blocks into structures with
         size <=512
      
      2) use one structure which describes ufs super block, and hope that array
         of "buffer_head" which holds "super block", has such construction:
      
      	bh[n]->b_data + bh[n]->b_size == bh[n + 1]->b_data
      
      The second variant may cause some problems in the future, and usage of two
      variants cause unnecessary code duplication.
      
      This patch remove the second variant.  Also patch contains some CodingStyle
      fixes.
      Signed-off-by: NEvgeniy Dushistov <dushistov@mail.ru>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      647b7e87
    • E
      [PATCH] ufs: little directory lookup optimization · dd187a26
      Evgeniy Dushistov 提交于
      This patch make little optimization of ufs_find_entry like "ext2" does.  Save
      number of page and reuse it again in the next call.
      Signed-off-by: NEvgeniy Dushistov <dushistov@mail.ru>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      dd187a26
    • E
      [PATCH] ufs: easy debug · abf5d15f
      Evgeniy Dushistov 提交于
      Currently to turn on debug mode "user" has to edit ~10 files, to turn off he
      has to do it again.
      
      This patch introduce such changes:
      1)turn on(off) debug messages via ".config"
      2)remove unnecessary duplication of code
      3)make "UFSD" macros more similar to function
      4)fix some compiler warnings
      Signed-off-by: NEvgeniy Dushistov <dushistov@mail.ru>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      abf5d15f
    • E
      [PATCH] ufs: wrong type cast · 9695ef16
      Evgeniy Dushistov 提交于
      There are two ugly macros in ufs code:
      #define UCPI_UBH ((struct ufs_buffer_head *)ucpi)
      #define USPI_UBH ((struct ufs_buffer_head *)uspi)
      when uspi looks like
      struct {
      struct ufs_buffer_head ;
      }
      and USPI_UBH has some sence,
      ucpi looks like
      struct {
      struct not_ufs_buffer_head;
      }
      
      To prevent bugs in future, this patch convert macros to inline function and
      fix "ucpi" structure.
      Signed-off-by: NEvgeniy Dushistov <dushistov@mail.ru>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      9695ef16