1. 19 Jul, 2009 1 commit
    • Rakib Mullick's avatar
      virtio_blk: mark virtio_blk with __refdata to kill spurious section mismatch · 4fbfff76
      Rakib Mullick authored
      The variable virtio_blk references the function virtblk_probe() (which
      is in .devinit section) and also references the function
      virtblk_remove() ( which is in .devexit section). So, virtio_blk
      simultaneously refers .devinit and .devexit section. To avoid this
      messup, we mark virtio_blk as __refdata.
      
      We were warned by the following warning:
      
        LD      drivers/block/built-in.o
        WARNING: drivers/block/built-in.o(.data+0xc8dc): Section mismatch in
        reference from the variable virtio_blk to the function
        .devinit.text:virtblk_probe()
        The variable virtio_blk references
        the function __devinit virtblk_probe()
        If the reference is valid then annotate the
        variable with __init* or __refdata (see linux/init.h) or name the variable:
        *driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console,
      
        WARNING: drivers/block/built-in.o(.data+0xc8e0): Section mismatch in
        reference from the variable virtio_blk to the function
        .devexit.text:virtblk_remove()
        The variable virtio_blk references
        the function __devexit virtblk_remove()
        If the reference is valid then annotate the
        variable with __exit* (see linux/init.h) or name the variable:
        *driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console,
      Signed-off-by: default avatarRakib Mullick <rakib.mullick@gmail.com>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      4fbfff76
  2. 17 Jul, 2009 3 commits
    • Xiaotian Feng's avatar
      block: sysfs fix mismatched queue_var_{store,show} in 64bit kernel · 9cb308ce
      Xiaotian Feng authored
      In blk-sysfs.c, queue_var_store uses unsigned long to store data,
      but queue_var_show uses unsigned int to show data.  This causes,
      
      	# echo 70000000000 > /sys/block/<dev>/queue/read_ahead_kb
      	# cat /sys/block/<dev>/queue/read_ahead_kb => get wrong value
      
      Fix it by using unsigned long.
      
      While at it, convert queue_rq_affinity_show() such that it uses bool
      variable instead of explicit != 0 testing.
      Signed-off-by: default avatarXiaotian Feng <dfeng@redhat.com>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      9cb308ce
    • Julia Lawall's avatar
      ataflop: adjust NULL test · 8f474287
      Julia Lawall authored
      dtp is derefenced on the lines above the test !dtp, and so it cannot be
      NULL at this point.
      
      A simplified version of the semantic match that finds this problem is as
      follows: (http://www.emn.fr/x-info/coccinelle/)
      
      // <smpl>
      @r@
      expression x,E,E1;
      identifier f,l;
      position p1,p2;
      @@
      
      *x@p1->f = E1;
      ... when != x = E
          when != goto l;
      (
      *x@p2 == NULL
      |
      *x@p2 != NULL
      )
      // </smpl>
      Signed-off-by: default avatarJulia Lawall <julia@diku.dk>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      8f474287
    • Tejun Heo's avatar
      block: fix failfast merge testing in elv_rq_merge_ok() · 0a09f431
      Tejun Heo authored
      Commit ab0fd1de tries to prevent merge
      of requests with different failfast settings.  In elv_rq_merge_ok(),
      it compares new bio's failfast flags against the merge target
      request's.  However, the flag testing accessors for bio and blk don't
      return boolean but the tested bit value directly and FAILFAST on bio
      and blk don't match, so directly comparing them with == results in
      false negative unnecessary preventing merge of readahead requests.
      
      This patch convert the results to boolean by negating them before
      comparison.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Cc: Jens Axboe <jens.axboe@oracle.com>
      Cc: Boaz Harrosh <bharrosh@panasas.com>
      Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
      Cc: Jeff Garzik <jeff@garzik.org>
      0a09f431
  3. 15 Jul, 2009 1 commit
  4. 10 Jul, 2009 11 commits
    • Vivek Goyal's avatar
      cfq-iosched: reset oom_cfqq in cfq_set_request() · 32f2e807
      Vivek Goyal authored
      In case memory is scarce, we now default to oom_cfqq. Once memory is
      available again, we should allocate a new cfqq and stop using oom_cfqq for
      a particular io context.
      
      Once a new request comes in, check if we are using oom_cfqq, and if yes,
      try to allocate a new cfqq.
      
      Tested the patch by forcing the use of oom_cfqq and upon next request thread
      realized that it was using oom_cfqq and it allocated a new cfqq.
      Signed-off-by: default avatarVivek Goyal <vgoyal@redhat.com>
      Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
      32f2e807
    • FUJITA Tomonori's avatar
      block: fix sg SG_DXFER_TO_FROM_DEV regression · ecb554a8
      FUJITA Tomonori authored
      I overlooked SG_DXFER_TO_FROM_DEV support when I converted sg to use
      the block layer mapping API (2.6.28).
      
      Douglas Gilbert explained SG_DXFER_TO_FROM_DEV:
      
      http://www.spinics.net/lists/linux-scsi/msg37135.html
      
      =
      The semantics of SG_DXFER_TO_FROM_DEV were:
         - copy user space buffer to kernel (LLD) buffer
         - do SCSI command which is assumed to be of the DATA_IN
           (data from device) variety. This would overwrite
           some or all of the kernel buffer
         - copy kernel (LLD) buffer back to the user space.
      
      The idea was to detect short reads by filling the original
      user space buffer with some marker bytes ("0xec" it would
      seem in this report). The "resid" value is a better way
      of detecting short reads but that was only added this century
      and requires co-operation from the LLD.
      =
      
      This patch changes the block layer mapping API to support this
      semantics. This simply adds another field to struct rq_map_data and
      enables __bio_copy_iov() to copy data from user space even with READ
      requests.
      
      It's better to add the flags field and kills null_mapped and the new
      from_user fields in struct rq_map_data but that approach makes it
      difficult to send this patch to stable trees because st and osst
      drivers use struct rq_map_data (they were converted to use the block
      layer in 2.6.29 and 2.6.30). Well, I should clean up the block layer
      mapping API.
      
      zhou sf reported this regiression and tested this patch:
      
      http://www.spinics.net/lists/linux-scsi/msg37128.html
      http://www.spinics.net/lists/linux-scsi/msg37168.htmlReported-by: default avatarzhou sf <sxzzsf@gmail.com>
      Tested-by: default avatarzhou sf <sxzzsf@gmail.com>
      Cc: stable@kernel.org
      Signed-off-by: default avatarFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
      ecb554a8
    • FUJITA Tomonori's avatar
      block: call blk_scsi_ioctl_init() · 76da0346
      FUJITA Tomonori authored
      Currently, blk_scsi_ioctl_init() is not called since it lacks
      an initcall marking. This causes the command table to be
      unitialized, hence somce commands are block when they should
      not have been.
      
      This fixes a regression introduced by commit
      018e0446Signed-off-by: default avatarFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
      76da0346
    • Jens Axboe's avatar
      Fix congestion_wait() sync/async vs read/write confusion · 8aa7e847
      Jens Axboe authored
      Commit 1faa16d2 accidentally broke
      the bdi congestion wait queue logic, causing us to wait on congestion
      for WRITE (== 1) when we really wanted BLK_RW_ASYNC (== 0) instead.
      Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
      8aa7e847
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6 · c2cc49a2
      Linus Torvalds authored
      * git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6:
        cifs: when ATTR_READONLY is set, only clear write bits on non-directories
        cifs: remove cifsInodeInfo->inUse counter
        cifs: convert cifs_get_inode_info and non-posix readdir to use cifs_iget
        [CIFS] update cifs version number
        cifs: add and use CIFSSMBUnixSetFileInfo for setattr calls
        cifs: make a separate function for filling out FILE_UNIX_BASIC_INFO
        cifs: rename CIFSSMBUnixSetInfo to CIFSSMBUnixSetPathInfo
        cifs: add pid of initiating process to spnego upcall info
        cifs: fix regression with O_EXCL creates and optimize away lookup
        cifs: add new cifs_iget function and convert unix codepath to use it
      c2cc49a2
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 · e864561c
      Linus Torvalds authored
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (29 commits)
        cxgb3: Fix crash caused by stashing wrong netdev_queue
        ixgbe: Fix coexistence of FCoE and Flow Director in 82599
        memory barrier: adding smp_mb__after_lock
        net: adding memory barrier to the poll and receive callbacks
        netpoll: Fix carrier detection for drivers that are using phylib
        includecheck fix: include/linux, rfkill.h
        p54: tx refused but queue active
        Atheros Kconfig needs to be dependent on WLAN_80211
        mac80211: fix docbook
        mac80211_hwsim: avoid NULL access
        ssb: Add support for 4318E
        b43: Add support for 4318E
        zd1211rw: adding SONY IFU-WLM2 (054c:0257) as a zd1211b device
        zd1211rw: 07b8:6001 is a ZD1211B
        r6040: bump driver version to 0.24 and date to 08 July 2009
        r6040: restore MIER register correctly when IRQ line is shared
        ipv4: Fix fib_trie rebalancing, part 4 (root thresholds)
        davinci_emac: fix kernel oops when changing MAC address while interface is down
        igb: set lan id prior to configuring phy
        mac80211: minstrel: avoid accessing negative indices in rix_to_ndx()
        ...
      e864561c
    • Dave Jones's avatar
      Fix compile error in bmac.c · 42359da4
      Dave Jones authored
      Looks like the change in ad361c98
      wasn't compile tested.
      Signed-off-by: default avatarDave Jones <davej@redhat.com>
      Acked-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      42359da4
    • Roland Dreier's avatar
      cxgb3: Fix crash caused by stashing wrong netdev_queue · e594e96e
      Roland Dreier authored
      Commit c3a8c5b6 ("cxgb3: move away from LLTX") exposed a bug in how
      cxgb3 looks up the netdev_queue it stashes away in a qset during
      initialization.  For multiport devices, the TX queue index it uses is
      offset by the first_qset index of each port.  This leads to a crash
      once LLTX is removed, since hard_start_xmit is called with one TX
      queue lock held, while the TX reclaim timer task grabs a different
      (wrong) TX queue lock when it frees skbs.
      
      Fix this by removing the first_qset offset used to look up the TX
      queue passed into t3_sge_alloc_qset() from setup_sge_qsets().
      Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
      Acked-by: default avatarDivy Le Ray <divy@chelsio.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e594e96e
    • Yi Zou's avatar
      ixgbe: Fix coexistence of FCoE and Flow Director in 82599 · 8faa2a78
      Yi Zou authored
      Fix coexistence of Fiber Channel over Ethernet (FCoE) and Flow Director (FDIR)
      in 82599 and remove the disabling of FDIR when FCoE is enabled.
      
      Currently, FDIR is turned off when FCoE is enabled under the assumption that
      FCoE is always enabled with DCB being turned on. However, FDIR does not have
      to be turned off all the time when FCoE is enabled since FCoE can be enabled
      without DCB being turned on, e.g., use link pause only. This patch makes sure
      that when DCB is turned on or off, FDIR is turned on or off correspondingly;
      and when FCoE is enabled, it does not disable FDIR, rather, it will have FDIR
      set up properly so FCoE and FDIR can coexist regardless of DCB being on or off.
      Signed-off-by: default avatarYi Zou <yi.zou@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8faa2a78
    • Jiri Olsa's avatar
      memory barrier: adding smp_mb__after_lock · ad462769
      Jiri Olsa authored
      Adding smp_mb__after_lock define to be used as a smp_mb call after
      a lock.
      
      Making it nop for x86, since {read|write|spin}_lock() on x86 are
      full memory barriers.
      Signed-off-by: default avatarJiri Olsa <jolsa@redhat.com>
      Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ad462769
    • Jiri Olsa's avatar
      net: adding memory barrier to the poll and receive callbacks · a57de0b4
      Jiri Olsa authored
      Adding memory barrier after the poll_wait function, paired with
      receive callbacks. Adding fuctions sock_poll_wait and sk_has_sleeper
      to wrap the memory barrier.
      
      Without the memory barrier, following race can happen.
      The race fires, when following code paths meet, and the tp->rcv_nxt
      and __add_wait_queue updates stay in CPU caches.
      
      CPU1                         CPU2
      
      sys_select                   receive packet
        ...                        ...
        __add_wait_queue           update tp->rcv_nxt
        ...                        ...
        tp->rcv_nxt check          sock_def_readable
        ...                        {
        schedule                      ...
                                      if (sk->sk_sleep && waitqueue_active(sk->sk_sleep))
                                              wake_up_interruptible(sk->sk_sleep)
                                      ...
                                   }
      
      If there was no cache the code would work ok, since the wait_queue and
      rcv_nxt are opposit to each other.
      
      Meaning that once tp->rcv_nxt is updated by CPU2, the CPU1 either already
      passed the tp->rcv_nxt check and sleeps, or will get the new value for
      tp->rcv_nxt and will return with new data mask.
      In both cases the process (CPU1) is being added to the wait queue, so the
      waitqueue_active (CPU2) call cannot miss and will wake up CPU1.
      
      The bad case is when the __add_wait_queue changes done by CPU1 stay in its
      cache, and so does the tp->rcv_nxt update on CPU2 side.  The CPU1 will then
      endup calling schedule and sleep forever if there are no more data on the
      socket.
      
      Calls to poll_wait in following modules were ommited:
      	net/bluetooth/af_bluetooth.c
      	net/irda/af_irda.c
      	net/irda/irnet/irnet_ppp.c
      	net/mac80211/rc80211_pid_debugfs.c
      	net/phonet/socket.c
      	net/rds/af_rds.c
      	net/rfkill/core.c
      	net/sunrpc/cache.c
      	net/sunrpc/rpc_pipe.c
      	net/tipc/socket.c
      Signed-off-by: default avatarJiri Olsa <jolsa@redhat.com>
      Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a57de0b4
  5. 09 Jul, 2009 12 commits
  6. 08 Jul, 2009 12 commits