1. 09 5月, 2007 1 次提交
  2. 03 5月, 2007 1 次提交
  3. 08 3月, 2007 1 次提交
    • D
      [PATCH] Add epoll compat_ code to fs/compat.c · f6dfb4fd
      Davide Libenzi 提交于
      IA64 and ARM-OABI are currently using their own version of epoll compat_
      code.
      
      An architecture needs epoll_event translation if alignof(u64) in 32 bit
      mode is different from alignof(u64) in 64 bit mode.  If an architecture
      needs epoll_event translation, it must define struct compat_epoll_event in
      asm/compat.h and set CONFIG_HAVE_COMPAT_EPOLL_EVENT and use
      compat_sys_epoll_ctl and compat_sys_epoll_wait.
      
      All 64 bit architecture should use compat_sys_epoll_pwait.
      
      [sfr: restructure and move to fs/compat.c, remove MIPS version
      of compat_sys_epoll_pwait, use __put_user_unaligned]
      Signed-off-by: NStephen Rothwell <sfr@canb.auug.org.au>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: Russell King <rmk@arm.linux.org.uk>
      Cc: "Luck, Tony" <tony.luck@intel.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      f6dfb4fd
  4. 11 12月, 2006 1 次提交
    • V
      [PATCH] fdtable: Make fdarray and fdsets equal in size · bbea9f69
      Vadim Lobanov 提交于
      Currently, each fdtable supports three dynamically-sized arrays of data: the
      fdarray and two fdsets.  The code allows the number of fds supported by the
      fdarray (fdtable->max_fds) to differ from the number of fds supported by each
      of the fdsets (fdtable->max_fdset).
      
      In practice, it is wasteful for these two sizes to differ: whenever we hit a
      limit on the smaller-capacity structure, we will reallocate the entire fdtable
      and all the dynamic arrays within it, so any delta in the memory used by the
      larger-capacity structure will never be touched at all.
      
      Rather than hogging this excess, we shouldn't even allocate it in the first
      place, and keep the capacities of the fdarray and the fdsets equal.  This
      patch removes fdtable->max_fdset.  As an added bonus, most of the supporting
      code becomes simpler.
      Signed-off-by: NVadim Lobanov <vlobanov@speakeasy.net>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Dipankar Sarma <dipankar@in.ibm.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      bbea9f69
  5. 09 12月, 2006 1 次提交
  6. 08 12月, 2006 2 次提交
  7. 04 12月, 2006 2 次提交
  8. 04 11月, 2006 1 次提交
  9. 11 10月, 2006 1 次提交
  10. 03 10月, 2006 1 次提交
    • D
      [PATCH] VFS: Make filldir_t and struct kstat deal in 64-bit inode numbers · afefdbb2
      David Howells 提交于
      These patches make the kernel pass 64-bit inode numbers internally when
      communicating to userspace, even on a 32-bit system.  They are required
      because some filesystems have intrinsic 64-bit inode numbers: NFS3+ and XFS
      for example.  The 64-bit inode numbers are then propagated to userspace
      automatically where the arch supports it.
      
      Problems have been seen with userspace (eg: ld.so) using the 64-bit inode
      number returned by stat64() or getdents64() to differentiate files, and
      failing because the 64-bit inode number space was compressed to 32-bits, and
      so overlaps occur.
      
      This patch:
      
      Make filldir_t take a 64-bit inode number and struct kstat carry a 64-bit
      inode number so that 64-bit inode numbers can be passed back to userspace.
      
      The stat functions then returns the full 64-bit inode number where
      available and where possible.  If it is not possible to represent the inode
      number supplied by the filesystem in the field provided by userspace, then
      error EOVERFLOW will be issued.
      
      Similarly, the getdents/readdir functions now pass the full 64-bit inode
      number to userspace where possible, returning EOVERFLOW instead when a
      directory entry is encountered that can't be properly represented.
      
      Note that this means that some inodes will not be stat'able on a 32-bit
      system with old libraries where they were before - but it does mean that
      there will be no ambiguity over what a 32-bit inode number refers to.
      
      Note similarly that directory scans may be cut short with an error on a
      32-bit system with old libraries where the scan would work before for the
      same reasons.
      
      It is judged unlikely that this situation will occur because modern glibc
      uses 64-bit capable versions of stat and getdents class functions
      exclusively, and that older systems are unlikely to encounter
      unrepresentable inode numbers anyway.
      
      [akpm: alpha build fix]
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Cc: Trond Myklebust <trond.myklebust@fys.uio.no>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      afefdbb2
  11. 02 10月, 2006 1 次提交
  12. 01 10月, 2006 3 次提交
  13. 26 9月, 2006 1 次提交
    • A
      [PATCH] Check return value of copy_to_user in compat_sys_pselect7 · 75833345
      Andi Kleen 提交于
      Fix
      
      linux/fs/compat.c: In function compat_sys_pselect7
      linux/fs/compat.c:1869: warning: ignoring return value of copy_to_user, declared with attribute warn_unused_result
      
      To make it easier to handle I changed to semantics to not try to
      write out a timespec if an error occurred. I hope that's ok.
      
      Cc: dwmw2@infradead.org
      Signed-off-by: NAndi Kleen <ak@suse.de>
      75833345
  14. 27 6月, 2006 1 次提交
  15. 23 6月, 2006 1 次提交
  16. 22 5月, 2006 1 次提交
    • L
      [PATCH] NFS: fix error handling on access_ok in compat_sys_nfsservctl · d64b1c87
      Lin Feng Shen 提交于
      Functions compat_nfs_svc_trans, compat_nfs_clnt_trans,
      compat_nfs_exp_trans, compat_nfs_getfd_trans and compat_nfs_getfs_trans,
      which are called by compat_sys_nfsservctl(fs/compat.c), don't handle the
      return value of access_ok properly.  access_ok return 1 when the addr is
      valid, and 0 when it's not, but these functions have the reversed
      understanding.  When the address is valid, they always return -EFAULT to
      compat_sys_nfsservctl.
      
      An example is to run /usr/sbin/rpc.nfsd(32bit program on Power5).  It
      doesn't function as expected.  strace showes that nfsservctl returns
      -EFAULT.
      
      The patch fixes this by correcting the error handling on the return value
      of access_ok in the five functions.
      Signed-off-by: NLin Feng Shen <shenlinf@cn.ibm.com>
      Cc: Trond Myklebust <trond.myklebust@fys.uio.no>
      Acked-by: NNeil Brown <neilb@suse.de>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      d64b1c87
  17. 16 5月, 2006 1 次提交
  18. 04 5月, 2006 1 次提交
  19. 02 5月, 2006 1 次提交
  20. 26 4月, 2006 1 次提交
  21. 29 3月, 2006 1 次提交
  22. 26 3月, 2006 2 次提交
  23. 24 3月, 2006 1 次提交
  24. 18 2月, 2006 1 次提交
  25. 12 2月, 2006 1 次提交
    • A
      [PATCH] select: fix returned timeval · 643a6545
      Andrew Morton 提交于
      With David Woodhouse <dwmw2@infradead.org>
      
      select() presently has a habit of increasing the value of the user's
      `timeout' argument on return.
      
      We were writing back a timeout larger than the original.  We _deliberately_
      round up, since we know we must wait at _least_ as long as the caller asks
      us to.
      
      The patch adds a couple of helper functions for magnitude comparison of
      timespecs and of timevals, and uses them to prevent the various poll and
      select functions from returning a timeout which is larger than the one which
      was passed in.
      
      The patch also fixes a bug in compat_sys_pselect7(): it was adding the new
      timeout value to the old one and was returning that.  It should just return
      the new timeout value.
      
      (We have various handy timespec/timeval-to-from-nsec conversion functions in
      time.h.  But this code open-codes it all).
      
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Andi Kleen <ak@muc.de>
      Cc: Ulrich Drepper <drepper@redhat.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: george anzinger <george@mvista.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      643a6545
  26. 02 2月, 2006 2 次提交
  27. 20 1月, 2006 1 次提交
  28. 19 1月, 2006 2 次提交
    • D
      [PATCH] Add pselect/ppoll system call implementation · 9f72949f
      David Woodhouse 提交于
      The following implementation of ppoll() and pselect() system calls
      depends on the architecture providing a TIF_RESTORE_SIGMASK flag in the
      thread_info.
      
      These system calls have to change the signal mask during their
      operation, and signal handlers must be invoked using the new, temporary
      signal mask. The old signal mask must be restored either upon successful
      exit from the system call, or upon returning from the invoked signal
      handler if the system call is interrupted. We can't simply restore the
      original signal mask and return to userspace, since the restored signal
      mask may actually block the signal which interrupted the system call.
      
      The TIF_RESTORE_SIGMASK flag deals with this by causing the syscall exit
      path to trap into do_signal() just as TIF_SIGPENDING does, and by
      causing do_signal() to use the saved signal mask instead of the current
      signal mask when setting up the stack frame for the signal handler -- or
      by causing do_signal() to simply restore the saved signal mask in the
      case where there is no handler to be invoked.
      
      The first patch implements the sys_pselect() and sys_ppoll() system
      calls, which are present only if TIF_RESTORE_SIGMASK is defined. That
      #ifdef should go away in time when all architectures have implemented
      it. The second patch implements TIF_RESTORE_SIGMASK for the PowerPC
      kernel (in the -mm tree), and the third patch then removes the
      arch-specific implementations of sys_rt_sigsuspend() and replaces them
      with generic versions using the same trick.
      
      The fourth and fifth patches, provided by David Howells, implement
      TIF_RESTORE_SIGMASK for FR-V and i386 respectively, and the sixth patch
      adds the syscalls to the i386 syscall table.
      
      This patch:
      
      Add the pselect() and ppoll() system calls, providing core routines usable by
      the original select() and poll() system calls and also the new calls (with
      their semantics w.r.t timeouts).
      Signed-off-by: NDavid Woodhouse <dwmw2@infradead.org>
      Cc: Michael Kerrisk <mtk-manpages@gmx.net>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      9f72949f
    • U
      [PATCH] vfs: *at functions: core · 5590ff0d
      Ulrich Drepper 提交于
      Here is a series of patches which introduce in total 13 new system calls
      which take a file descriptor/filename pair instead of a single file
      name.  These functions, openat etc, have been discussed on numerous
      occasions.  They are needed to implement race-free filesystem traversal,
      they are necessary to implement a virtual per-thread current working
      directory (think multi-threaded backup software), etc.
      
      We have in glibc today implementations of the interfaces which use the
      /proc/self/fd magic.  But this code is rather expensive.  Here are some
      results (similar to what Jim Meyering posted before).
      
      The test creates a deep directory hierarchy on a tmpfs filesystem.  Then
      rm -fr is used to remove all directories.  Without syscall support I get
      this:
      
      real    0m31.921s
      user    0m0.688s
      sys     0m31.234s
      
      With syscall support the results are much better:
      
      real    0m20.699s
      user    0m0.536s
      sys     0m20.149s
      
      The interfaces are for obvious reasons currently not much used.  But they'll
      be used.  coreutils (and Jeff's posixutils) are already using them.
      Furthermore, code like ftw/fts in libc (maybe even glob) will also start using
      them.  I expect a patch to make follow soon.  Every program which is walking
      the filesystem tree will benefit.
      Signed-off-by: NUlrich Drepper <drepper@redhat.com>
      Signed-off-by: NAlexey Dobriyan <adobriyan@gmail.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Al Viro <viro@ftp.linux.org.uk>
      Acked-by: NIngo Molnar <mingo@elte.hu>
      Cc: Michael Kerrisk <mtk-manpages@gmx.net>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      5590ff0d
  29. 15 1月, 2006 1 次提交
  30. 09 1月, 2006 1 次提交
    • N
      [PATCH] Fix overflow tests for compat_sys_fcntl64 locking · 2520f14c
      NeilBrown 提交于
      When making an fctl locking call through compat_sys_fcntl64 (i.e.  a 32bit
      app on a 64bit kernel), the syscall can return a locking range that is in
      conflict with the queried lock.
      
      If some aspect of this range does not fit in the 32bit structure, something
      needs to be done.
      
      The current code is wrong in several respects:
      
      - It returns data to userspace even if no conflict was found
         i.e. it should check l_type for F_UNLCK
      - It returns -EOVERFLOW too agressively.   A lock range covering
        the last possible byte of the file (start = COMPAT_OFF_T_MAX,
        len = 1) should be possible, but is rejected with the current test.
      - A extra-long 'len' should not be a problem.  If only that part
        of the conflicting lock that would be visible to the 32bit
        app needs to be reported to the 32bit app anyway.
      
      This patch addresses those three issues and adds a comment to (hopefully)
      record it for posterity.
      
      Note: this patch mainly affects test-cases.  Real applications rarely is
      ever see the problems.
      
      This patch has been tested (LSB test suite), and works.
      Signed-off-by: NNeil Brown <neilb@suse.de>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Matthew Wilcox <willy@debian.org>
      Cc: Trond Myklebust <trond.myklebust@fys.uio.no>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      2520f14c
  31. 05 1月, 2006 1 次提交
    • L
      Relax the rw_verify_area() error checking. · e28cc715
      Linus Torvalds 提交于
      In particular, allow over-large read- or write-requests to be downgraded
      to a more reasonable range, rather than considering them outright errors.
      
      We want to protect lower layers from (the sadly all too common) overflow
      conditions, but prefer to do so by chopping the requests up, rather than
      just refusing them outright.
      
      Cc: Peter Anvin <hpa@zytor.com>
      Cc: Ulrich Drepper <drepper@redhat.com>
      Cc: Andi Kleen <ak@suse.de>
      Cc: Al Viro <viro@ftp.linux.org.uk>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      e28cc715
  32. 23 11月, 2005 1 次提交
    • D
      [PATCH] Fix error handling with put_compat_statfs() · 86e07ce7
      David Gibson 提交于
      In fs/compat.c, whenever put_compat_statfs() returns an error, the
      containing syscall returns -EFAULT.  This is presumably by analogy with the
      non-compat case, where any non-zero code from copy_to_user() should be
      translated into an EFAULT.  However, put_compat_statfs() is also return
      -EOVERFLOW.  The same applies for put_compat_statfs64().
      
      This bug can be observed with a statfs() on a hugetlbfs directory.
      hugetlbfs, when mounted without limits reports available, free and total
      blocks as -1 (itself a bug, another patch coming).  statfs() will
      mysteriously return EFAULT although it's parameters are perfectly valid
      addresses.
      
      This patch causes the compat versions of statfs() and statfs64() to
      correctly propogate the return values from put_compat_statfs() and
      put_compat_statfs64().
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      86e07ce7
  33. 21 11月, 2005 1 次提交