1. 18 Jul, 2014 31 commits
  2. 17 Jul, 2014 9 commits
    • Emmanuel Grumbach's avatar
      iwlwifi: pcie: try to get ownership several times · 78a97b52
      Emmanuel Grumbach authored
      commit 501fd989 upstream.
      
      Some races with the hardware can happen when we take
      ownership of the device. Don't give up after the first try.
      Reviewed-by: default avatarJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      78a97b52
    • Felix Fietkau's avatar
      mac80211: fix a memory leak on sta rate selection table · 2cee6288
      Felix Fietkau authored
      commit 53d04525 upstream.
      
      If the rate control algorithm uses a selection table, it
      is leaked when the station is destroyed - fix that.
      Signed-off-by: default avatarFelix Fietkau <nbd@openwrt.org>
      Reported-by: default avatarChristophe Prévotaux <cprevotaux@nltinc.com>
      Fixes: 0d528d85 ("mac80211: improve the rate control API")
      [add commit log entry, remove pointless NULL check]
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      2cee6288
    • Arik Nemtsov's avatar
      mac80211: don't check netdev state for debugfs read/write · 3174f279
      Arik Nemtsov authored
      commit 923eaf36 upstream.
      
      Doing so will lead to an oops for a p2p-dev interface, since it has
      no netdev.
      Signed-off-by: default avatarArik Nemtsov <arikx.nemtsov@intel.com>
      Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      3174f279
    • Krzysztof Hałasa's avatar
      mac80211: fix IBSS join by initializing last_scan_completed · 8b623dad
      Krzysztof Hałasa authored
      commit c7d37a66 upstream.
      
      Without this fix, freshly rebooted Linux creates a new IBSS
      instead of joining an existing one. Only when jiffies counter
      overflows after 5 minutes the IBSS can be successfully joined.
      Signed-off-by: default avatarKrzysztof Hałasa <khalasa@piap.pl>
      [edit commit message slightly]
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      8b623dad
    • Fabio Baltieri's avatar
      hwmon: (ina2xx) Cast to s16 on shunt and current regs · d9f8ab9c
      Fabio Baltieri authored
      commit c0214f98 upstream.
      
      All devices supported by ina2xx are bidirectional and report the
      measured shunt voltage and power values as a signed 16 bit, but the
      current driver implementation caches all registers as u16, leading
      to an incorrect sign extension when reporting to userspace in
      ina2xx_get_value().
      
      This patch fixes the problem by casting the signed registers to s16.
      Tested on an INA219.
      Signed-off-by: default avatarFabio Baltieri <fabio.baltieri@gmail.com>
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      d9f8ab9c
    • Ilya Dryomov's avatar
      rbd: handle parent_overlap on writes correctly · a355e863
      Ilya Dryomov authored
      commit 9638556a upstream.
      
      The following check in rbd_img_obj_request_submit()
      
          rbd_dev->parent_overlap <= obj_request->img_offset
      
      allows the fall through to the non-layered write case even if both
      parent_overlap and obj_request->img_offset belong to the same RADOS
      object.  This leads to data corruption, because the area to the left of
      parent_overlap ends up unconditionally zero-filled instead of being
      populated with parent data.  Suppose we want to write 1M to offset 6M
      of image bar, which is a clone of foo@snap; object_size is 4M,
      parent_overlap is 5M:
      
          rbd_data.<id>.0000000000000001
           ---------------------|----------------------|------------
          | should be copyup'ed | should be zeroed out | write ...
           ---------------------|----------------------|------------
         4M                    5M                     6M
                          parent_overlap    obj_request->img_offset
      
      4..5M should be copyup'ed from foo, yet it is zero-filled, just like
      5..6M is.
      
      Given that the only striping mode kernel client currently supports is
      chunking (i.e. stripe_unit == object_size, stripe_count == 1), round
      parent_overlap up to the next object boundary for the purposes of the
      overlap check.
      Signed-off-by: default avatarIlya Dryomov <ilya.dryomov@inktank.com>
      Reviewed-by: default avatarJosh Durgin <josh.durgin@inktank.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      a355e863
    • Alex Elder's avatar
      rbd: use reference counts for image requests · 1ef3eb28
      Alex Elder authored
      commit 0f2d5be7 upstream.
      
      Each image request contains a reference count, but to date it has
      not actually been used.  (I think this was just an oversight.) A
      recent report involving rbd failing an assertion shed light on why
      and where we need to use these reference counts.
      
      Every OSD request associated with an object request uses
      rbd_osd_req_callback() as its callback function.  That function will
      call a helper function (dependent on the type of OSD request) that
      will set the object request's "done" flag if the object request if
      appropriate.  If that "done" flag is set, the object request is
      passed to rbd_obj_request_complete().
      
      In rbd_obj_request_complete(), requests are processed in sequential
      order.  So if an object request completes before one of its
      predecessors in the image request, the completion is deferred.
      Otherwise, if it's a completing object's "turn" to be completed, it
      is passed to rbd_img_obj_end_request(), which records the result of
      the operation, accumulates transferred bytes, and so on.  Next, the
      successor to this request is checked and if it is marked "done",
      (deferred) completion processing is performed on that request, and
      so on.  If the last object request in an image request is completed,
      rbd_img_request_complete() is called, which (typically) destroys
      the image request.
      
      There is a race here, however.  The instant an object request is
      marked "done" it can be provided (by a thread handling completion of
      one of its predecessor operations) to rbd_img_obj_end_request(),
      which (for the last request) can then lead to the image request
      getting torn down.  And this can happen *before* that object has
      itself entered rbd_img_obj_end_request().  As a result, once it
      *does* enter that function, the image request (and even the object
      request itself) may have been freed and become invalid.
      
      All that's necessary to avoid this is to properly count references
      to the image requests.  We tear down an image request's object
      requests all at once--only when the entire image request has
      completed.  So there's no need for an image request to count
      references for its object requests.  However, we don't want an
      image request to go away until the last of its object requests
      has passed through rbd_img_obj_callback().  In other words,
      we don't want rbd_img_request_complete() to necessarily
      result in the image request being destroyed, because it may
      get called before we've finished processing on all of its
      object requests.
      
      So the fix is to add a reference to an image request for
      each of its object requests.  The reference can be viewed
      as representing an object request that has not yet finished
      its call to rbd_img_obj_callback().  That is emphasized by
      getting the reference right after assigning that as the image
      object's callback function.  The corresponding release of that
      reference is done at the end of rbd_img_obj_callback(), which
      every image object request passes through exactly once.
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Reviewed-by: default avatarIlya Dryomov <ilya.dryomov@inktank.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      1ef3eb28
    • Lukas Czerner's avatar
      dm thin: update discard_granularity to reflect the thin-pool blocksize · 6e9a6814
      Lukas Czerner authored
      commit 09869de5 upstream.
      
      DM thinp already checks whether the discard_granularity of the data
      device is a factor of the thin-pool block size.  But when using the
      dm-thin-pool's discard passdown support, DM thinp was not selecting the
      max of the underlying data device's discard_granularity and the
      thin-pool's block size.
      
      Update set_discard_limits() to set discard_granularity to the max of
      these values.  This enables blkdev_issue_discard() to properly align the
      discards that are sent to the DM thin device on a full block boundary.
      As such each discard will now cover an entire DM thin-pool block and the
      block will be reclaimed.
      Reported-by: default avatarZdenek Kabelac <zkabelac@redhat.com>
      Signed-off-by: default avatarLukas Czerner <lczerner@redhat.com>
      Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      6e9a6814
    • Marcin Kraglak's avatar
      Bluetooth: Allow change security level on ATT_CID in slave role · 350c598f
      Marcin Kraglak authored
      commit 92d1372e upstream.
      
      Kernel supports SMP Security Request so don't block increasing security
      when we are slave.
      Signed-off-by: default avatarMarcin Kraglak <marcin.kraglak@tieto.com>
      Acked-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      350c598f