1. 01 12月, 2008 9 次提交
    • E
      [XFS] Hook up the fiemap ioctl. · f35642e2
      Eric Sandeen 提交于
      This adds the fiemap inode_operation, which for us converts the
      fiemap values & flags into a getbmapx structure which can be sent
      to xfs_getbmap.  The formatter then copies the bmv array back into
      the user's fiemap buffer via the fiemap helpers.
      
      If we wanted to be more clever, we could also return mapping data
      for in-inode attributes, but I'm not terribly motivated to do that
      just yet.
      Signed-off-by: NEric Sandeen <sandeen@sandeen.net>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NNiv Sardi <xaiki@sgi.com>
      f35642e2
    • E
      [XFS] Add new getbmap flags. · 5af317c9
      Eric Sandeen 提交于
      This adds a new output flag, BMV_OF_LAST to indicate if we've hit
      the last extent in the inode.  This potentially saves an extra call
      from userspace to see when the whole mapping is done.
      
      It also adds BMV_IF_DELALLOC and BMV_OF_DELALLOC to request, and
      indicate, delayed-allocation extents.  In this case bmv_block
      is set to -2 (-1 was already taken for HOLESTARTBLOCK; unfortunately
      these are the reverse of the in-kernel constants.)
      
      These new flags facilitate addition of the new fiemap interface.
      
      Rather than adding sh_delalloc, remove sh_unwritten & just test
      the flags directly.
      Signed-off-by: NEric Sandeen <sandeen@sandeen.net>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NNiv Sardi <xaiki@sgi.com>
      5af317c9
    • E
      [XFS] convert xfs_getbmap to take formatter functions · 8a7141a8
      Eric Sandeen 提交于
      Preliminary work to hook up fiemap, this allows us to pass in an
      arbitrary formatter to copy extent data back to userspace.
      
      The formatter takes info for 1 extent, a pointer to the user "thing*"
      and a pointer to a "filled" variable to indicate whether a userspace
      buffer did get filled in (for fiemap, hole "extents" are skipped).
      
      I'm just using the getbmapx struct as a "common denominator" because
      as far as I can see, it holds all info that any formatters will care
      about.
      
      ("*thing" because fiemap doesn't pass the user pointer around, but rather
      has a pointer to a fiemap info structure, and helpers associated with it)
      Signed-off-by: NEric Sandeen <sandeen@sandeen.net>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NNiv Sardi <xaiki@sgi.com>
      8a7141a8
    • D
      [XFS] fix uninitialised variable bug in dquot release. · 0924b585
      Dave Chinner 提交于
      gcc is warning about an uninitialised variable in xfs_growfs_rt().
      This is a false positive. Fix it by changing the scope of the
      transaction pointer to wholly within the internal loop inside
      the function.
      
      While there, preemptively change xfs_growfs_rt_alloc() in the
      same way as it has exactly the same structure as xfs_growfs_rt()
      but gcc is not warning about it. Yet.
      Signed-off-by: NDave Chinner <david@fromorbit.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NNiv Sardi <xaiki@sgi.com>
      0924b585
    • D
      [XFS] fix error inversion problems with data flushing · 2e656092
      Dave Chinner 提交于
      XFS gets the sign of the error wrong in several places when
      gathering the error from generic linux functions. These functions
      return negative error values, while the core XFS code returns
      positive error values. Hence when XFS inverts the error to be
      returned to the VFS, it can incorrectly invert a negative
      error and this error will be ignored by the syscall return.
      
      Fix all the problems related to calling filemap_* functions.
      
      Problem initially identified by Nick Piggin in xfs_fsync().
      Signed-off-by: NDave Chinner <david@fromorbit.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NNiv Sardi <xaiki@sgi.com>
      2e656092
    • C
      [XFS] fix spurious gcc warnings · 65795910
      Christoph Hellwig 提交于
      Some recent gcc warnings don't like passing string variables to
      printf-like functions without using at least a "%s" format string.
      Change the two occurances of that in xfs to please gcc.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Reviewed-by: NEric Sandeen <sandeen@sandeen.net>
      Signed-off-by: NNiv Sardi <xaiki@sgi.com>
      65795910
    • C
      [XFS] allow inode64 mount option on 32 bit systems · 6c31b93a
      Christoph Hellwig 提交于
      Now that we've stopped using the Linux inode cache when can trivally
      support the inode64 mount option on 32bit architectures.  As far as the
      kernel and most userspace is concerned this works perfectly, but
      applications still using really old stat and readdir interfaces will get
      an EOVERFLOW error when hitting an inode number not fitting into 32
      bits (that problem of course also exists when using these applications
      on a 64bit kernel).
      
      Note that because inode64 is simply a mount option we can currently
      mount a filesystem having > 32 bit inode numbers and cause a variety of
      problems, all this is solved but this patch which enables XFS_BIG_INUMS,
      even when inode64 is not used.
      
      (First sent on October 18th)
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Reviewed-by: NDave Chinner <david@fromorbit.com>
      Signed-off-by: NNiv Sardi <xaiki@sgi.com>
      6c31b93a
    • C
      [XFS] wire up ->open for directories · f999a5bf
      Christoph Hellwig 提交于
      Currently there's no ->open method set for directories on XFS.  That
      means we don't perform any check for opening too large directories
      without O_LARGEFILE, we don't check for shut down filesystems, and we
      don't actually do the readahead for the first block in the directory.
      
      Instead of just setting the directories open routine to xfs_file_open
      we merge the shutdown check directly into xfs_file_open and create
      a new xfs_dir_open that first calls xfs_file_open and then performs
      the readahead for block 0.
      
      (First sent on September 29th)
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Reviewed-by: NDave Chinner <david@fromorbit.com>
      Signed-off-by: NNiv Sardi <xaiki@sgi.com>
      f999a5bf
    • C
      [XFS] fix NULL pointer dereference in xfs_log_force_umount · bac8dca9
      Christoph Hellwig 提交于
      xfs_log_force_umount may be called very early during log recovery where
      
      If we fail a buffer read in xlog_recover_do_inode_trans we abort the mount.
      But at that point log recovery has started delayed writeback of inode
      buffers.   As part of the aborted mount we try to flush out all delwri
      buffers, but at that point we have already freed the superblock, and set
      mp->m_sb_bp to NULL, and xfs_log_force_umount which gets called after
      the inode buffer writeback trips over it.
      
      Make xfs_log_force_umount a little more careful when accessing mp->m_sb_bp
      to avoid this.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Reviewed-by: NEric Sandeen <sandeen@sandeen.net>
      Signed-off-by: NNiv Sardi <xaiki@sgi.com>
      bac8dca9
  2. 28 11月, 2008 1 次提交
  3. 21 11月, 2008 25 次提交
  4. 20 11月, 2008 5 次提交
    • A
      net: fix tiny output corruption of /proc/net/snmp6 · 5ece6c2d
      Alexey Dobriyan 提交于
      Because "name" is static, it can be occasionally be filled with
      somewhat garbage if two processes read /proc/net/snmp6.
      
      Also, remove useless casts and "-1" -- snprintf() correctly terminates it's
      output.
      Signed-off-by: NAlexey Dobriyan <adobriyan@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5ece6c2d
    • A
      atl2: don't request irq on resume if netif running · a849854f
      Alan Jenkins 提交于
      If the device is suspended with the cable disconnected, then
      resumed with the cable connected, dev->open is called before
      resume. During resume, we request an IRQ, but the IRQ was
      already assigned during dev->open, resulting in the warning
      shown below.
      
      Don't request an IRQ if the device is running.
      
      Call Trace:
       [<c011b89a>] warn_on_slowpath+0x40/0x59
       [<c023df15>] raw_pci_read+0x4d/0x55
       [<c023dff3>] pci_read+0x1c/0x21
       [<c01bcd81>] __pci_find_next_cap_ttl+0x44/0x70
       [<c01bce86>] __pci_find_next_cap+0x1a/0x1f
       [<c01bcef9>] pci_find_capability+0x28/0x2c
       [<c01c4144>] pci_msi_check_device+0x53/0x62
       [<c01c49c2>] pci_enable_msi+0x3a/0x1cd
       [<e019f17b>] atl2_write_phy_reg+0x40/0x5f [atl2]
       [<c01061b1>] dma_generic_alloc_coherent+0x0/0xd7
       [<e019f107>] atl2_request_irq+0x15/0x49 [atl2]
       [<e01a1481>] atl2_open+0x20b/0x297 [atl2]
       [<c024a35c>] dev_open+0x62/0x91
       [<c0248b9a>] dev_change_flags+0x93/0x141
       [<c024f308>] do_setlink+0x238/0x2d5
       [<c02501b2>] rtnl_setlink+0xa9/0xbf
       [<c0297f0c>] mutex_lock+0xb/0x19
       [<c024ffa7>] rtnl_dump_ifinfo+0x0/0x69
       [<c0250109>] rtnl_setlink+0x0/0xbf
       [<c024fe42>] rtnetlink_rcv_msg+0x185/0x19f
       [<c0240fd1>] sock_rmalloc+0x23/0x57
       [<c024fcbd>] rtnetlink_rcv_msg+0x0/0x19f
       [<c0259457>] netlink_rcv_skb+0x2d/0x71
       [<c024fcb7>] rtnetlink_rcv+0x14/0x1a
       [<c025929e>] netlink_unicast+0x184/0x1e4
       [<c025992a>] netlink_sendmsg+0x233/0x240
       [<c023f405>] sock_sendmsg+0xb7/0xd0
       [<c0129131>] autoremove_wake_function+0x0/0x2b
       [<c0129131>] autoremove_wake_function+0x0/0x2b
       [<c0147796>] mempool_alloc+0x2d/0x9e
       [<c020c923>] scsi_pool_alloc_command+0x35/0x4f
       [<c0297f0c>] mutex_lock+0xb/0x19
       [<c028e867>] unix_stream_recvmsg+0x357/0x3e2
       [<c01b81c9>] copy_from_user+0x23/0x4f
       [<c02452ea>] verify_iovec+0x3e/0x6c
       [<c023f5ab>] sys_sendmsg+0x18d/0x1f0
       [<c023ffa8>] sys_recvmsg+0x146/0x1c8
       [<c0240016>] sys_recvmsg+0x1b4/0x1c8
       [<c0118f48>] __wake_up+0xf/0x15
       [<c02586cd>] netlink_table_ungrab+0x17/0x19
       [<c01b83ba>] copy_to_user+0x25/0x3b
       [<c023fe4a>] move_addr_to_user+0x50/0x68
       [<c0240266>] sys_getsockname+0x6f/0x9a
       [<c0240280>] sys_getsockname+0x89/0x9a
       [<c015046a>] do_wp_page+0x3ae/0x41a
       [<c0151525>] handle_mm_fault+0x4c5/0x540
       [<c02405d0>] sys_socketcall+0x176/0x1b0
       [<c010376d>] sysenter_do_call+0x12/0x21
      Signed-off-by: NAlan Jenkins <alan-jenkins@tuffmail.co.uk>
      Signed-off-by: NJay Cliburn <jcliburn@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a849854f
    • B
      ipv6: use seq_release_private for ip6mr.c /proc entries · eedd726e
      Benjamin Thery 提交于
      In ip6mr.c, /proc entries /proc/net/ip6_mr_cache and /proc/net/ip6_mr_vif
      are opened with seq_open_private(), thus seq_release_private() should be 
      used to release them.
      Should fix a small memory leak.
      Signed-off-by: NBenjamin Thery <benjamin.thery@bull.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      eedd726e
    • P
      pkt_sched: fix missing check for packet overrun in qdisc_dump_stab() · 3aa4614d
      Patrick McHardy 提交于
      nla_nest_start() might return NULL, causing a NULL pointer dereference.
      Signed-off-by: NPatrick McHardy <kaber@trash.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3aa4614d
    • D