Update to 3.2.41

svn path=/dists/sid/linux/; revision=19924
This commit is contained in:
Ben Hutchings 2013-03-21 00:43:02 +00:00
parent 2949691cda
commit 8542c98990
7 changed files with 127 additions and 252 deletions

30
debian/changelog vendored
View File

@ -1,4 +1,4 @@
linux (3.2.40-1) UNRELEASED; urgency=low
linux (3.2.41-1) UNRELEASED; urgency=low
* New upstream stable update:
http://www.kernel.org/pub/linux/kernel/v3.x/ChangeLog-3.2.40
@ -46,6 +46,34 @@ linux (3.2.40-1) UNRELEASED; urgency=low
AI commands
- staging: comedi: ni_labpc: set up command4 register *after* command3
- vhost: fix length for cross region descriptor (CVE-2013-0311)
http://www.kernel.org/pub/linux/kernel/v3.x/ChangeLog-3.2.41
- NFS: Don't allow NFS silly-renamed files to be deleted, no signal
- ARM: VFP: fix emulation of second VFP instruction
- md: fix two bugs when attempting to resize RAID0 array.
- proc connector: reject unprivileged listener bumps
- cifs: ensure that cifs_get_root() only traverses directories
- dm: fix truncated status strings
- hw_random: make buffer usable in scatterlist. (real fix for #701784)
- efi_pstore: Check remaining space with QueryVariableInfo() before
writing data
- efi: be more paranoid about available space when creating variables
(Closes: #703574)
- vfs: fix pipe counter breakage
- xen/pciback: Don't disable a PCI device that is already disabled.
- ALSA: seq: Fix missing error handling in snd_seq_timer_open()
- ext3: Fix format string issues (CVE-2013-1848)
- keys: fix race with concurrent install_user_keyrings() (CVE-2013-1792)
- USB: cdc-wdm: fix buffer overflow (CVE-2013-1860)
- signal: always clear sa_restorer on execve (CVE-2013-0914)
- crypto: user - fix info leaks in report API (CVE-2013-2546,
CVE-2013-2547, CVE-2013-2548)
- Fix: compat_rw_copy_check_uvector() misuse in aio, readv, writev, and
security keys
- batman-adv: bat_socket_read missing checks
- batman-adv: Only write requested number of byte to user buffer
- mm/hotplug: correctly add new zone to all other nodes' zone lists
(CVE-2012-5517)
- btrfs: use rcu_barrier() to wait for bdev puts at unmount
[ Aurelien Jarno]
* [mips,mipsel] Disable VGA_CONSOLE and ignore the corresponding ABI

View File

@ -1,41 +0,0 @@
From: Sebastian Riemer <sebastian.riemer@profitbricks.com>
Date: Fri, 25 Jan 2013 12:46:59 +0100
Subject: md: protect against crash upon fsync on ro array
Bug-Debian: http://bugs.debian.org/696650
commit 0ecfa11f08c79be05eb00bba537e764e6672774d upstream.
If an fsync occurs on a read-only array, we need to send a
completion for the IO and may not increment the active IO count.
Otherwise, we hit a bug trace and can't stop the MD array anymore.
By advice of Christoph Hellwig we return success upon a flush
request but we return -EROFS for other writes.
We detect flush requests by checking if the bio has zero sectors.
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Ben Hutchings <ben@decadent.org.uk>
Cc: NeilBrown <neilb@suse.de>
Signed-off-by: Sebastian Riemer <sebastian.riemer@profitbricks.com>
Reported-by: Ben Hutchings <ben@decadent.org.uk>
Acked-by: Paul Menzel <paulepanter@users.sourceforge.net>
Signed-off-by: NeilBrown <neilb@suse.de>
---
drivers/md/md.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 3db3d1b..1e634a6 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -307,6 +307,10 @@ static void md_make_request(struct request_queue *q, struct bio *bio)
bio_io_error(bio);
return;
}
+ if (mddev->ro == 1 && unlikely(rw == WRITE)) {
+ bio_endio(bio, bio_sectors(bio) == 0 ? 0 : -EROFS);
+ return;
+ }
smp_rmb(); /* Ensure implications of 'active' are visible */
rcu_read_lock();
if (mddev->suspended) {

View File

@ -47732,7 +47732,7 @@ index fee0ad0..342ffb7 100644
drm_encoder_helper_add(&crt->base.base, &intel_crt_helper_funcs);
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 2303c2b..3c9b9c5 100644
index 4591582..3c9b9c5 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -75,7 +75,7 @@ struct intel_limit {
@ -49149,7 +49149,46 @@ index 2303c2b..3c9b9c5 100644
err:
return ret;
}
@@ -7559,10 +7838,9 @@ static void intel_setup_outputs(struct drm_device *dev)
@@ -7280,8 +7559,8 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,
{
struct drm_device *dev = crtc->dev;
struct drm_i915_private *dev_priv = dev->dev_private;
- struct drm_framebuffer *old_fb = crtc->fb;
- struct drm_i915_gem_object *obj = to_intel_framebuffer(fb)->obj;
+ struct intel_framebuffer *intel_fb;
+ struct drm_i915_gem_object *obj;
struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
struct intel_unpin_work *work;
unsigned long flags;
@@ -7293,7 +7572,8 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,
work->event = event;
work->dev = crtc->dev;
- work->old_fb_obj = to_intel_framebuffer(old_fb)->obj;
+ intel_fb = to_intel_framebuffer(crtc->fb);
+ work->old_fb_obj = intel_fb->obj;
INIT_WORK(&work->work, intel_unpin_work_fn);
ret = drm_vblank_get(dev, intel_crtc->pipe);
@@ -7313,6 +7593,9 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,
intel_crtc->unpin_work = work;
spin_unlock_irqrestore(&dev->event_lock, flags);
+ intel_fb = to_intel_framebuffer(fb);
+ obj = intel_fb->obj;
+
mutex_lock(&dev->struct_mutex);
/* Reference the objects for the scheduled work. */
@@ -7343,7 +7626,6 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,
cleanup_pending:
atomic_sub(1 << intel_crtc->plane, &work->old_fb_obj->pending_flip);
- crtc->fb = old_fb;
drm_gem_object_unreference(&work->old_fb_obj->base);
drm_gem_object_unreference(&obj->base);
mutex_unlock(&dev->struct_mutex);
@@ -7556,10 +7838,9 @@ static void intel_setup_outputs(struct drm_device *dev)
struct drm_i915_private *dev_priv = dev->dev_private;
struct intel_encoder *encoder;
bool dpd_is_edp = false;
@ -49162,7 +49201,7 @@ index 2303c2b..3c9b9c5 100644
if (!has_lvds && !HAS_PCH_SPLIT(dev)) {
/* disable the panel fitter on everything but LVDS */
I915_WRITE(PFIT_CONTROL, 0);
@@ -7691,7 +7969,7 @@ static const struct drm_framebuffer_funcs intel_fb_funcs = {
@@ -7688,7 +7969,7 @@ static const struct drm_framebuffer_funcs intel_fb_funcs = {
int intel_framebuffer_init(struct drm_device *dev,
struct intel_framebuffer *intel_fb,
@ -49171,7 +49210,7 @@ index 2303c2b..3c9b9c5 100644
struct drm_i915_gem_object *obj)
{
int ret;
@@ -7699,21 +7977,27 @@ int intel_framebuffer_init(struct drm_device *dev,
@@ -7696,21 +7977,27 @@ int intel_framebuffer_init(struct drm_device *dev,
if (obj->tiling_mode == I915_TILING_Y)
return -EINVAL;
@ -49209,7 +49248,7 @@ index 2303c2b..3c9b9c5 100644
return -EINVAL;
}
@@ -7731,11 +8015,12 @@ int intel_framebuffer_init(struct drm_device *dev,
@@ -7728,11 +8015,12 @@ int intel_framebuffer_init(struct drm_device *dev,
static struct drm_framebuffer *
intel_user_framebuffer_create(struct drm_device *dev,
struct drm_file *filp,
@ -49224,7 +49263,7 @@ index 2303c2b..3c9b9c5 100644
if (&obj->base == NULL)
return ERR_PTR(-ENOENT);
@@ -8004,7 +8289,7 @@ void intel_init_emon(struct drm_device *dev)
@@ -8001,7 +8289,7 @@ void intel_init_emon(struct drm_device *dev)
dev_priv->corr = (lcfuse & LCFUSE_HIV_MASK);
}
@ -49233,7 +49272,7 @@ index 2303c2b..3c9b9c5 100644
{
/*
* Respect the kernel parameter if it is set
@@ -8022,11 +8307,11 @@ static bool intel_enable_rc6(struct drm_device *dev)
@@ -8019,11 +8307,11 @@ static bool intel_enable_rc6(struct drm_device *dev)
* Disable rc6 on Sandybridge
*/
if (INTEL_INFO(dev)->gen == 6) {
@ -49249,7 +49288,7 @@ index 2303c2b..3c9b9c5 100644
}
void gen6_enable_rps(struct drm_i915_private *dev_priv)
@@ -8034,7 +8319,9 @@ void gen6_enable_rps(struct drm_i915_private *dev_priv)
@@ -8031,7 +8319,9 @@ void gen6_enable_rps(struct drm_i915_private *dev_priv)
u32 rp_state_cap = I915_READ(GEN6_RP_STATE_CAP);
u32 gt_perf_status = I915_READ(GEN6_GT_PERF_STATUS);
u32 pcu_mbox, rc6_mask = 0;
@ -49259,7 +49298,7 @@ index 2303c2b..3c9b9c5 100644
int i;
/* Here begins a magic sequence of register writes to enable
@@ -8045,6 +8332,13 @@ void gen6_enable_rps(struct drm_i915_private *dev_priv)
@@ -8042,6 +8332,13 @@ void gen6_enable_rps(struct drm_i915_private *dev_priv)
*/
I915_WRITE(GEN6_RC_STATE, 0);
mutex_lock(&dev_priv->dev->struct_mutex);
@ -49273,7 +49312,7 @@ index 2303c2b..3c9b9c5 100644
gen6_gt_force_wake_get(dev_priv);
/* disable the counters and set deterministic thresholds */
@@ -8065,9 +8359,20 @@ void gen6_enable_rps(struct drm_i915_private *dev_priv)
@@ -8062,9 +8359,20 @@ void gen6_enable_rps(struct drm_i915_private *dev_priv)
I915_WRITE(GEN6_RC6p_THRESHOLD, 100000);
I915_WRITE(GEN6_RC6pp_THRESHOLD, 64000); /* unused */
@ -49297,7 +49336,7 @@ index 2303c2b..3c9b9c5 100644
I915_WRITE(GEN6_RC_CONTROL,
rc6_mask |
@@ -8295,6 +8600,10 @@ static void gen6_init_clock_gating(struct drm_device *dev)
@@ -8292,6 +8600,10 @@ static void gen6_init_clock_gating(struct drm_device *dev)
I915_WRITE(WM2_LP_ILK, 0);
I915_WRITE(WM1_LP_ILK, 0);
@ -49308,7 +49347,7 @@ index 2303c2b..3c9b9c5 100644
/* According to the BSpec vol1g, bit 12 (RCPBUNIT) clock
* gating disable must be set. Failure to set it results in
* flickering pixels due to Z write ordering failures after
@@ -8373,6 +8682,10 @@ static void ivybridge_init_clock_gating(struct drm_device *dev)
@@ -8370,6 +8682,10 @@ static void ivybridge_init_clock_gating(struct drm_device *dev)
I915_WRITE(ILK_DSPCLK_GATE, IVB_VRHUNIT_CLK_GATE);
@ -49319,7 +49358,7 @@ index 2303c2b..3c9b9c5 100644
/* Apply the WaDisableRHWOOptimizationForRenderHang workaround. */
I915_WRITE(GEN7_COMMON_SLICE_CHICKEN1,
GEN7_CSC1_RHWO_OPT_DISABLE_IN_RCC);
@@ -8683,9 +8996,15 @@ static void intel_init_display(struct drm_device *dev)
@@ -8680,9 +8996,15 @@ static void intel_init_display(struct drm_device *dev)
if (IS_IVYBRIDGE(dev)) {
u32 ecobus;
@ -49336,7 +49375,7 @@ index 2303c2b..3c9b9c5 100644
__gen6_gt_force_wake_mt_put(dev_priv);
mutex_unlock(&dev->struct_mutex);
@@ -8717,6 +9036,7 @@ static void intel_init_display(struct drm_device *dev)
@@ -8714,6 +9036,7 @@ static void intel_init_display(struct drm_device *dev)
} else if (IS_GEN6(dev)) {
if (SNB_READ_WM0_LATENCY()) {
dev_priv->display.update_wm = sandybridge_update_wm;
@ -49344,7 +49383,7 @@ index 2303c2b..3c9b9c5 100644
} else {
DRM_DEBUG_KMS("Failed to read display plane latency. "
"Disable CxSR\n");
@@ -8730,6 +9050,7 @@ static void intel_init_display(struct drm_device *dev)
@@ -8727,6 +9050,7 @@ static void intel_init_display(struct drm_device *dev)
dev_priv->display.fdi_link_train = ivb_manual_fdi_link_train;
if (SNB_READ_WM0_LATENCY()) {
dev_priv->display.update_wm = sandybridge_update_wm;
@ -49352,7 +49391,7 @@ index 2303c2b..3c9b9c5 100644
} else {
DRM_DEBUG_KMS("Failed to read display plane latency. "
"Disable CxSR\n");
@@ -8842,8 +9163,6 @@ struct intel_quirk {
@@ -8839,8 +9163,6 @@ struct intel_quirk {
};
struct intel_quirk intel_quirks[] = {
@ -49361,7 +49400,7 @@ index 2303c2b..3c9b9c5 100644
/* HP Mini needs pipe A force quirk (LP: #322104) */
{ 0x27ae, 0x103c, 0x361a, quirk_pipea_force },
@@ -8910,33 +9229,19 @@ static void i915_disable_vga(struct drm_device *dev)
@@ -8907,33 +9229,19 @@ static void i915_disable_vga(struct drm_device *dev)
POSTING_READ(vga_reg);
}
@ -49399,7 +49438,7 @@ index 2303c2b..3c9b9c5 100644
dev->mode_config.funcs = (void *)&intel_mode_funcs;
intel_init_quirks(dev);
@@ -8960,6 +9265,9 @@ void intel_modeset_init(struct drm_device *dev)
@@ -8957,6 +9265,9 @@ void intel_modeset_init(struct drm_device *dev)
for (i = 0; i < dev_priv->num_pipe; i++) {
intel_crtc_init(dev, i);
@ -85756,10 +85795,26 @@ index b6e18c8..9c6b29a 100644
tmp = RREG32_PLL(RADEON_VCLK_ECP_CNTL);
tmp &= ~(RADEON_PIXCLK_ALWAYS_ONb |
diff --git a/drivers/gpu/drm/radeon/radeon_combios.c b/drivers/gpu/drm/radeon/radeon_combios.c
index ec36dd9..a2470d9 100644
index c32fd93..a2470d9 100644
--- a/drivers/gpu/drm/radeon/radeon_combios.c
+++ b/drivers/gpu/drm/radeon/radeon_combios.c
@@ -1536,9 +1536,6 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
@@ -958,15 +958,6 @@ struct radeon_encoder_primary_dac *radeon_combios_get_primary_dac_info(struct
found = 1;
}
- /* quirks */
- /* Radeon 9100 (R200) */
- if ((dev->pdev->device == 0x514D) &&
- (dev->pdev->subsystem_vendor == 0x174B) &&
- (dev->pdev->subsystem_device == 0x7149)) {
- /* vbios value is bad, use the default */
- found = 0;
- }
-
if (!found) /* fallback to defaults */
radeon_legacy_get_primary_dac_info_from_table(rdev, p_dac);
@@ -1545,9 +1536,6 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
of_machine_is_compatible("PowerBook6,7")) {
/* ibook */
rdev->mode_info.connector_table = CT_IBOOK;
@ -85769,7 +85824,7 @@ index ec36dd9..a2470d9 100644
} else if (of_machine_is_compatible("PowerMac4,4")) {
/* emac */
rdev->mode_info.connector_table = CT_EMAC;
@@ -1564,11 +1561,6 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
@@ -1573,11 +1561,6 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
(rdev->pdev->subsystem_device == 0x4150)) {
/* Mac G5 tower 9600 */
rdev->mode_info.connector_table = CT_MAC_G5_9600;
@ -85781,7 +85836,7 @@ index ec36dd9..a2470d9 100644
} else
#endif /* CONFIG_PPC_PMAC */
#ifdef CONFIG_PPC64
@@ -2142,115 +2134,6 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
@@ -2151,115 +2134,6 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
CONNECTOR_OBJECT_ID_SVIDEO,
&hpd);
break;
@ -85897,7 +85952,7 @@ index ec36dd9..a2470d9 100644
default:
DRM_INFO("Connector table: %d (invalid)\n",
rdev->mode_info.connector_table);
@@ -2970,7 +2853,7 @@ bool radeon_combios_external_tmds_setup(struct drm_encoder *encoder)
@@ -2979,7 +2853,7 @@ bool radeon_combios_external_tmds_setup(struct drm_encoder *encoder)
case 4:
val = RBIOS16(index);
index += 2;
@ -85906,7 +85961,7 @@ index ec36dd9..a2470d9 100644
break;
case 6:
slave_addr = id & 0xff;
@@ -3169,7 +3052,7 @@ static void combios_parse_pll_table(struct drm_device *dev, uint16_t offset)
@@ -3178,7 +3052,7 @@ static void combios_parse_pll_table(struct drm_device *dev, uint16_t offset)
udelay(150);
break;
case 2:
@ -85915,7 +85970,7 @@ index ec36dd9..a2470d9 100644
break;
case 3:
while (tmp--) {
@@ -3200,13 +3083,13 @@ static void combios_parse_pll_table(struct drm_device *dev, uint16_t offset)
@@ -3209,13 +3083,13 @@ static void combios_parse_pll_table(struct drm_device *dev, uint16_t offset)
/*mclk_cntl |= 0x00001111;*//* ??? */
WREG32_PLL(RADEON_MCLK_CNTL,
mclk_cntl);

View File

@ -1,164 +0,0 @@
From: Alan Stern <stern@rowland.harvard.edu>
Date: Thu, 17 Nov 2011 16:42:19 -0500
Subject: [PATCH 01/77] NLS: improve UTF8 -> UTF16 string conversion routine
commit 0720a06a7518c9d0c0125bd5d1f3b6264c55c3dd upstream.
The utf8s_to_utf16s conversion routine needs to be improved. Unlike
its utf16s_to_utf8s sibling, it doesn't accept arguments specifying
the maximum length of the output buffer or the endianness of its
16-bit output.
This patch (as1501) adds the two missing arguments, and adjusts the
only two places in the kernel where the function is called. A
follow-on patch will add a third caller that does utilize the new
capabilities.
The two conversion routines are still annoyingly inconsistent in the
way they handle invalid byte combinations. But that's a subject for a
different patch.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
CC: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/hv/hv_kvp.c | 10 ++++++----
fs/fat/namei_vfat.c | 3 ++-
fs/nls/nls_base.c | 43 +++++++++++++++++++++++++++++++++----------
include/linux/nls.h | 5 +++--
4 files changed, 44 insertions(+), 17 deletions(-)
diff --git a/drivers/hv/hv_kvp.c b/drivers/hv/hv_kvp.c
index 89f5244..0e8343f 100644
--- a/drivers/hv/hv_kvp.c
+++ b/drivers/hv/hv_kvp.c
@@ -212,11 +212,13 @@ kvp_respond_to_host(char *key, char *value, int error)
* The windows host expects the key/value pair to be encoded
* in utf16.
*/
- keylen = utf8s_to_utf16s(key_name, strlen(key_name),
- (wchar_t *)kvp_data->data.key);
+ keylen = utf8s_to_utf16s(key_name, strlen(key_name), UTF16_HOST_ENDIAN,
+ (wchar_t *) kvp_data->data.key,
+ HV_KVP_EXCHANGE_MAX_KEY_SIZE / 2);
kvp_data->data.key_size = 2*(keylen + 1); /* utf16 encoding */
- valuelen = utf8s_to_utf16s(value, strlen(value),
- (wchar_t *)kvp_data->data.value);
+ valuelen = utf8s_to_utf16s(value, strlen(value), UTF16_HOST_ENDIAN,
+ (wchar_t *) kvp_data->data.value,
+ HV_KVP_EXCHANGE_MAX_VALUE_SIZE / 2);
kvp_data->data.value_size = 2*(valuelen + 1); /* utf16 encoding */
kvp_data->data.value_type = REG_SZ; /* all our values are strings */
diff --git a/fs/fat/namei_vfat.c b/fs/fat/namei_vfat.c
index a87a656..c25cf15 100644
--- a/fs/fat/namei_vfat.c
+++ b/fs/fat/namei_vfat.c
@@ -512,7 +512,8 @@ xlate_to_uni(const unsigned char *name, int len, unsigned char *outname,
int charlen;
if (utf8) {
- *outlen = utf8s_to_utf16s(name, len, (wchar_t *)outname);
+ *outlen = utf8s_to_utf16s(name, len, UTF16_HOST_ENDIAN,
+ (wchar_t *) outname, FAT_LFN_LEN + 2);
if (*outlen < 0)
return *outlen;
else if (*outlen > FAT_LFN_LEN)
diff --git a/fs/nls/nls_base.c b/fs/nls/nls_base.c
index 44a88a9..0eb059e 100644
--- a/fs/nls/nls_base.c
+++ b/fs/nls/nls_base.c
@@ -114,34 +114,57 @@ int utf32_to_utf8(unicode_t u, u8 *s, int maxlen)
}
EXPORT_SYMBOL(utf32_to_utf8);
-int utf8s_to_utf16s(const u8 *s, int len, wchar_t *pwcs)
+static inline void put_utf16(wchar_t *s, unsigned c, enum utf16_endian endian)
+{
+ switch (endian) {
+ default:
+ *s = (wchar_t) c;
+ break;
+ case UTF16_LITTLE_ENDIAN:
+ *s = __cpu_to_le16(c);
+ break;
+ case UTF16_BIG_ENDIAN:
+ *s = __cpu_to_be16(c);
+ break;
+ }
+}
+
+int utf8s_to_utf16s(const u8 *s, int len, enum utf16_endian endian,
+ wchar_t *pwcs, int maxlen)
{
u16 *op;
int size;
unicode_t u;
op = pwcs;
- while (*s && len > 0) {
+ while (len > 0 && maxlen > 0 && *s) {
if (*s & 0x80) {
size = utf8_to_utf32(s, len, &u);
if (size < 0)
return -EINVAL;
+ s += size;
+ len -= size;
if (u >= PLANE_SIZE) {
+ if (maxlen < 2)
+ break;
u -= PLANE_SIZE;
- *op++ = (wchar_t) (SURROGATE_PAIR |
- ((u >> 10) & SURROGATE_BITS));
- *op++ = (wchar_t) (SURROGATE_PAIR |
+ put_utf16(op++, SURROGATE_PAIR |
+ ((u >> 10) & SURROGATE_BITS),
+ endian);
+ put_utf16(op++, SURROGATE_PAIR |
SURROGATE_LOW |
- (u & SURROGATE_BITS));
+ (u & SURROGATE_BITS),
+ endian);
+ maxlen -= 2;
} else {
- *op++ = (wchar_t) u;
+ put_utf16(op++, u, endian);
+ maxlen--;
}
- s += size;
- len -= size;
} else {
- *op++ = *s++;
+ put_utf16(op++, *s++, endian);
len--;
+ maxlen--;
}
}
return op - pwcs;
diff --git a/include/linux/nls.h b/include/linux/nls.h
index d47beef..5dc635f 100644
--- a/include/linux/nls.h
+++ b/include/linux/nls.h
@@ -43,7 +43,7 @@ enum utf16_endian {
UTF16_BIG_ENDIAN
};
-/* nls.c */
+/* nls_base.c */
extern int register_nls(struct nls_table *);
extern int unregister_nls(struct nls_table *);
extern struct nls_table *load_nls(char *);
@@ -52,7 +52,8 @@ extern struct nls_table *load_nls_default(void);
extern int utf8_to_utf32(const u8 *s, int len, unicode_t *pu);
extern int utf32_to_utf8(unicode_t u, u8 *s, int maxlen);
-extern int utf8s_to_utf16s(const u8 *s, int len, wchar_t *pwcs);
+extern int utf8s_to_utf16s(const u8 *s, int len,
+ enum utf16_endian endian, wchar_t *pwcs, int maxlen);
extern int utf16s_to_utf8s(const wchar_t *pwcs, int len,
enum utf16_endian endian, u8 *s, int maxlen);
--
1.7.9.5

View File

@ -10,12 +10,12 @@ relocate the bounce buffer handling code (to avoid having forward declarations).
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[bwh: Adjusted to apply after backported commit 9d2696e658ef
'[SCSI] storvsc: Initialize the sglist']
---
drivers/staging/hv/storvsc_drv.c | 630 +++++++++++++++++++-------------------
1 file changed, 313 insertions(+), 317 deletions(-)
diff --git a/drivers/staging/hv/storvsc_drv.c b/drivers/staging/hv/storvsc_drv.c
index 204b3ca..7c9fa19 100644
--- a/drivers/staging/hv/storvsc_drv.c
+++ b/drivers/staging/hv/storvsc_drv.c
@@ -276,7 +276,6 @@ struct hv_storvsc_request {
@ -26,7 +26,7 @@ index 204b3ca..7c9fa19 100644
struct hv_multipage_buffer data_buffer;
struct vstor_packet vstor_packet;
@@ -436,6 +435,227 @@ get_in_err:
@@ -436,6 +435,228 @@ get_in_err:
}
@ -89,6 +89,7 @@ index 204b3ca..7c9fa19 100644
+ if (!bounce_sgl)
+ return NULL;
+
+ sg_init_table(bounce_sgl, num_pages);
+ for (i = 0; i < num_pages; i++) {
+ page_buf = alloc_page(GFP_ATOMIC);
+ if (!page_buf)
@ -254,7 +255,7 @@ index 204b3ca..7c9fa19 100644
static int storvsc_channel_init(struct hv_device *device)
{
struct storvsc_device *stor_device;
@@ -562,24 +782,101 @@ cleanup:
@@ -562,23 +783,100 @@ cleanup:
return ret;
}
@ -296,7 +297,6 @@ index 204b3ca..7c9fa19 100644
- * MODE_SENSE command with cmd[2] == 0x1c
- *
- * Setup srb and scsi status so this won't be fatal.
- * We do this so we can distinguish truly fatal failues
+ * If there is an error; offline the device since all
+ * error recovery strategies would have already been
+ * deployed on the host side.
@ -366,11 +366,10 @@ index 204b3ca..7c9fa19 100644
+ * MODE_SENSE command with cmd[2] == 0x1c
+ *
+ * Setup srb and scsi status so this won't be fatal.
+ * We do this so we can distinguish truly fatal failues
* We do this so we can distinguish truly fatal failues
* (srb status == 0x4) and off-line the device in that case.
*/
@@ -625,7 +922,7 @@ static void storvsc_on_io_completion(struct hv_device *device,
@@ -625,7 +923,7 @@ static void storvsc_on_io_completion(str
stor_pkt->vm_srb.data_transfer_length =
vstor_packet->vm_srb.data_transfer_length;
@ -379,7 +378,7 @@ index 204b3ca..7c9fa19 100644
if (atomic_dec_and_test(&stor_device->num_outstanding_req) &&
stor_device->drain_notify)
@@ -875,229 +1172,6 @@ static int storvsc_device_configure(struct scsi_device *sdevice)
@@ -875,230 +1173,6 @@ static int storvsc_device_configure(stru
return 0;
}
@ -442,6 +441,7 @@ index 204b3ca..7c9fa19 100644
- if (!bounce_sgl)
- return NULL;
-
- sg_init_table(bounce_sgl, num_pages);
- for (i = 0; i < num_pages; i++) {
- page_buf = alloc_page(GFP_ATOMIC);
- if (!page_buf)
@ -609,7 +609,7 @@ index 204b3ca..7c9fa19 100644
static int storvsc_get_chs(struct scsi_device *sdev, struct block_device * bdev,
sector_t capacity, int *info)
{
@@ -1166,83 +1240,6 @@ static int storvsc_host_reset_handler(struct scsi_cmnd *scmnd)
@@ -1172,83 +1246,6 @@ static int storvsc_host_reset_handler(st
return SUCCESS;
}
@ -693,7 +693,7 @@ index 204b3ca..7c9fa19 100644
static bool storvsc_scsi_cmd_ok(struct scsi_cmnd *scmnd)
{
bool allowed = true;
@@ -1318,7 +1315,6 @@ static int storvsc_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *scmnd)
@@ -1324,7 +1321,6 @@ static int storvsc_queuecommand(struct S
break;
}
@ -701,6 +701,3 @@ index 204b3ca..7c9fa19 100644
request->context = cmd_request;/* scmnd; */
vm_srb->port_number = host_dev->port;
--
1.7.9.5

View File

@ -19,9 +19,9 @@ directory.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Acked-by: James Bottomley <JBottomley@Parallels.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[bwh: Adjusted to apply after commit 5c1b10ab7f93d24f29b5630286e323d1c5802d5c
('storvsc: Account for in-transit packets in the RESET path') backported
in 3.2.33, moving that fix to the new file]
[bwh: Adjusted to apply after backported commits 5c1b10ab7f93
'[SCSI] storvsc: Account for in-transit packets in the RESET path' and
9d2696e658ef '[SCSI] storvsc: Initialize the sglist']
---
--- a/drivers/scsi/Kconfig
+++ b/drivers/scsi/Kconfig
@ -60,7 +60,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sd_mod-objs := sd.o
--- /dev/null
+++ b/drivers/scsi/storvsc_drv.c
@@ -0,0 +1,1553 @@
@@ -0,0 +1,1554 @@
+/*
+ * Copyright (c) 2009, Microsoft Corporation.
+ *
@ -530,6 +530,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+ if (!bounce_sgl)
+ return NULL;
+
+ sg_init_table(bounce_sgl, num_pages);
+ for (i = 0; i < num_pages; i++) {
+ page_buf = alloc_page(GFP_ATOMIC);
+ if (!page_buf)
@ -1659,7 +1660,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-Haiyang Zhang <haiyangz@microsoft.com>, and K. Y. Srinivasan <kys@microsoft.com>
--- a/drivers/staging/hv/storvsc_drv.c
+++ /dev/null
@@ -1,1553 +0,0 @@
@@ -1,1554 +0,0 @@
-/*
- * Copyright (c) 2009, Microsoft Corporation.
- *
@ -2129,6 +2130,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
- if (!bounce_sgl)
- return NULL;
-
- sg_init_table(bounce_sgl, num_pages);
- for (i = 0; i < num_pages; i++) {
- page_buf = alloc_page(GFP_ATOMIC);
- if (!page_buf)

View File

@ -67,7 +67,6 @@ features/all/fs-handle-failed-audit_log_start-properly.patch
features/all/fs-prevent-use-after-free-in-auditing-when-symlink-f.patch
# Update all Hyper-V drivers to 3.4-rc1 (no longer staging)
features/x86/hyperv/0001-NLS-improve-UTF8-UTF16-string-conversion-routine.patch
features/x86/hyperv/0002-HID-Move-the-hid-hyperv-driver-out-of-staging.patch
features/x86/hyperv/0003-Staging-hv-storvsc-Use-mempools-to-allocate-struct-s.patch
features/x86/hyperv/0004-Staging-hv-storvsc-Cleanup-error-handling-in-the-pro.patch
@ -439,7 +438,6 @@ features/all/iguanair/0009-media-rc-do-not-wake-up-rc-thread-unless-there-is-so.
features/all/iguanair/0010-media-iguanair-do-not-modify-transmit-buffer.patch
features/all/iguanair/0011-media-iguanair-cannot-send-data-from-the-stack.patch
features/all/rt2800-add-chipset-revision-RT5390R-support.patch
bugfix/all/md-protect-against-crash-upon-fsync-on-ro-array.patch
debian/net-avoid-ABI-break-in-3.2.37.patch
features/all/net-define-netdev_features_t.patch