Linux 3.18.80
Greg KH
maintainerI'm announcing the release of the 3.18.80 kernel.
All users of the 3.18 kernel series must upgrade.
The updated 3.18.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-3.18.y
and can be browsed at the normal kernel.org git web browser:
http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Makefile | 2 arch/arm/include/asm/Kbuild | 1 arch/arm/include/asm/unaligned.h | 27 ++++ arch/arm64/kernel/traps.c | 2 arch/x86/kernel/cpu/microcode/intel.c | 18 ++ block/blk-flush.c | 15 ++ block/blk-mq-tag.c | 2 block/blk-mq-tag.h | 12 + block/blk-mq.c | 16 -- block/blk.h | 6 drivers/gpu/drm/msm/msm_gem_submit.c | 7 - drivers/i2c/busses/i2c-riic.c | 30 +++- drivers/media/pci/bt8xx/dvb-bt8xx.c | 1 drivers/media/usb/cx231xx/cx231xx-core.c | 7 - drivers/mmc/host/s3cmci.c | 1 drivers/platform/x86/intel_mid_thermal.c | 1 drivers/s390/block/dasd.c | 7 - drivers/staging/lustre/lustre/include/lustre/lustre_user.h | 18 +- drivers/staging/lustre/lustre/ldlm/ldlm_lock.c | 7 + drivers/staging/lustre/lustre/ptlrpc/service.c | 21 +-- drivers/staging/rtl8712/ieee80211.h | 84 ++++++------- drivers/staging/rtl8712/rtl871x_xmit.c | 7 - drivers/xen/manage.c | 12 + fs/cifs/dir.c | 5 fs/ext4/mballoc.c | 6 fs/ext4/super.c | 4 fs/ocfs2/alloc.c | 24 ++- lib/asn1_decoder.c | 3 security/keys/keyring.c | 39 ++---- sound/core/seq/seq_clientmgr.c | 2 sound/core/timer_compat.c | 17 ++ sound/soc/codecs/adau17x1.c | 24 +++ sound/soc/codecs/adau17x1.h | 2 33 files changed, 292 insertions(+), 138 deletions(-)
Alexander Boyko (1):
staging: lustre: ptlrpc: skip lock if export failed
Arnd Bergmann (2):
ARM: 8715/1: add a private asm/unaligned.h
mmc: s3cmci: include linux/interrupt.h for tasklet_struct
Ashish Samant (1):
ocfs2: fstrim: Fix start offset of first cluster group during fstrim
Borislav Petkov (1):
x86/microcode/intel: Disable late loading on model 79
Chris Brandt (1):
i2c: riic: correctly finish transfers
Dan Carpenter (1):
drm/msm: fix an integer overflow test
Eric Biggers (2):
KEYS: return full count in keyring_read() if buffer is too small
KEYS: fix out-of-bounds read during ASN.1 parsing
Greg Kroah-Hartman (1):
Linux 3.18.80
Jan Beulich (1):
xen/manage: correct return value check on xenbus_scanf()
Jan Kara (2):
ext4: fix stripe-unaligned allocations
ext4: do not use stripe_width if it is not set
Javier Martinez Canillas (1):
platform/x86: intel_mid_thermal: Fix module autoload
Juergen Gross (1):
xen: don't print error message in case of missing Xenstore entry
Kasin Li (1):
drm/msm: Fix potential buffer overflow issue
Larry Finger (2):
staging: rtl8712u: Fix endian settings for structs describing network packets
staging: r8712u: Fix Sparse warning in rtl871x_xmit.c
Mark Rutland (1):
arm64: ensure __dump_instr() checks addr_limit
Ming Lei (1):
blk-mq: fix race between timeout and freeing request
Oleh Kravchenko (1):
cx231xx: Fix I2C on Internal Master 3 Bus
Ricard Wanderlof (1):
ASoC: adau17x1: Workaround for noise bug in ADC
Ronnie Sahlberg (1):
cifs: check MaxPathNameComponentLength != 0 before using it
Stefan Haberland (1):
s390/dasd: check for device error pointer within state change interrupts
Sudip Mukherjee (1):
bt8xx: fix memory leak
Takashi Iwai (2):
ALSA: timer: Add missing mutex lock for compat ioctls
ALSA: seq: Fix nested rwsem annotation for lockdep splat
frank zago (1):
staging: lustre: hsm: stack overrun in hai_dump_data_field
Greg KH
maintainerMakefile +1 -1
@@ -1,6 +1,6 @@ VERSION = 3 PATCHLEVEL = 18 -SUBLEVEL = 79 +SUBLEVEL = 80 EXTRAVERSION = NAME = Diseased Newt
arch/arm/include/asm/Kbuild +0 -1
@@ -37,4 +37,3 @@ generic-y += termbits.h generic-y += termios.h generic-y += timex.h generic-y += trace_clock.h -generic-y += unaligned.h
arch/arm/include/asm/unaligned.h new file +27 -0
@@ -0,0 +1,27 @@ +#ifndef __ASM_ARM_UNALIGNED_H +#define __ASM_ARM_UNALIGNED_H + +/* +* We generally want to set CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS on ARMv6+, +* but we don't want to use linux/unaligned/access_ok.h since that can lead +* to traps on unaligned stm/ldm or strd/ldrd. +*/ +#include <asm/byteorder.h> + +#if defined(__LITTLE_ENDIAN) +# include <linux/unaligned/le_struct.h> +# include <linux/unaligned/be_byteshift.h> +# include <linux/unaligned/generic.h> +# define get_unaligned __get_unaligned_le +# define put_unaligned __put_unaligned_le +#elif defined(__BIG_ENDIAN) +# include <linux/unaligned/be_struct.h> +# include <linux/unaligned/le_byteshift.h> +# include <linux/unaligned/generic.h> +# define get_unaligned __get_unaligned_be +# define put_unaligned __put_unaligned_be +#else +# error need to define endianess +#endif + +#endif /* __ASM_ARM_UNALIGNED_H */
arch/arm64/kernel/traps.c +1 -1
@@ -115,7 +115,7 @@ static void dump_instr(const char *lvl, struct pt_regs *regs)for (i =-4 ; i <1 ; i++) {unsigned int val, bad; - bad =__get_user (val, &((u32 *)addr)[i]); + bad =get_user (val, &((u32 *)addr)[i]);if (!bad) p +=sprintf (p, i ==0 ?"(%08x) " :"%08x " , val);
arch/x86/kernel/cpu/microcode/intel.c +18 -0
@@ -267,6 +267,18 @@ static int get_ucode_fw(void *to, const void *from, size_t n)return 0 ; } +static bool is_blacklisted (unsigned int cpu) +{ +struct cpuinfo_x86 *c = &cpu_data (cpu); + +if (c->x86 ==6 && c->x86_model ==79 ) { +pr_err_once ("late loading on model 79 is disabled.\n" ); +return true; + } + +return false; +} +static enum ucode_state request_microcode_fw (int cpu,struct device *device,bool refresh_fw) {
@@ -275,6 +287,9 @@ static enum ucode_state request_microcode_fw(int cpu, struct device *device,const struct firmware *firmware;enum ucode_state ret; +if (is_blacklisted (cpu)) +return UCODE_NFOUND ; +sprintf (name,"intel-ucode/%02x-%02x-%02x" , c->x86, c->x86_model, c->x86_mask);
@@ -299,6 +314,9 @@ static int get_ucode_user(void *to, const void *from, size_t n)static enum ucode_state request_microcode_user (int cpu,const void __user *buf,size_t size) { +if (is_blacklisted (cpu)) +return UCODE_NFOUND ; +return generic_load_microcode (cpu, (void *)buf, size, &get_ucode_user); }
block/blk-flush.c +14 -1
@@ -73,6 +73,7 @@#include "blk.h" #include "blk-mq.h" +#include "blk-mq-tag.h" /* FLUSH/FUA sequences */ enum {
@@ -226,7 +227,12 @@ static void flush_end_io(struct request *flush_rq, int error)struct blk_flush_queue *fq =blk_get_flush_queue (q, flush_rq->mq_ctx);if (q->mq_ops) { +struct blk_mq_hw_ctx *hctx; + +/* release the tag's ownership to the req cloned from */ spin_lock_irqsave (&fq->mq_flush_lock, flags); + hctx = q->mq_ops->map_queue (q, flush_rq->mq_ctx->cpu); +blk_mq_tag_set_rq (hctx, flush_rq->tag, fq->orig_rq); flush_rq->tag =-1 ; }
@@ -308,11 +314,18 @@ static bool blk_kick_flush(struct request_queue *q, struct blk_flush_queue *fq)/* * Borrow tag from the first request since they can't -* be in flight at the same time. +* be in flight at the same time. And acquire the tag's +* ownership for flush req. */ if (q->mq_ops) { +struct blk_mq_hw_ctx *hctx; + flush_rq->mq_ctx = first_rq->mq_ctx; flush_rq->tag = first_rq->tag; + fq->orig_rq = first_rq; + + hctx = q->mq_ops->map_queue (q, first_rq->mq_ctx->cpu); +blk_mq_tag_set_rq (hctx, first_rq->tag, flush_rq); } flush_rq->cmd_type =REQ_TYPE_FS ;
block/blk-mq-tag.c +1 -1
@@ -403,7 +403,7 @@ static void bt_for_each(struct blk_mq_hw_ctx *hctx,for (bit =find_first_bit (&bm->word, bm->depth); bit < bm->depth; bit =find_next_bit (&bm->word, bm->depth, bit +1 )) { - rq =blk_mq_tag_to_rq (hctx->tags, off + bit); + rq = hctx->tags->rqs[off + bit];if (rq->q == hctx->queue)fn (hctx, rq, data, reserved); }
block/blk-mq-tag.h +12 -0
@@ -85,4 +85,16 @@ static inline void blk_mq_tag_idle(struct blk_mq_hw_ctx *hctx) __blk_mq_tag_idle(hctx); } +/* +* This helper should only be used for flush request to share tag +* with the request cloned from, and both the two requests can't be +* in flight at the same time. The caller has to make sure the tag +* can't be freed. +*/ +static inline void blk_mq_tag_set_rq (struct blk_mq_hw_ctx *hctx, +unsigned int tag,struct request *rq) +{ + hctx->tags->rqs[tag] = rq; +} +#endif
block/blk-mq.c +1 -15
@@ -498,23 +498,9 @@ void blk_mq_kick_requeue_list(struct request_queue *q) }EXPORT_SYMBOL (blk_mq_kick_requeue_list); -static inline bool is_flush_request (struct request *rq, -struct blk_flush_queue *fq,unsigned int tag) -{ -return ((rq->cmd_flags &REQ_FLUSH_SEQ ) && - fq->flush_rq->tag == tag); -} -struct request *blk_mq_tag_to_rq (struct blk_mq_tags *tags,unsigned int tag) { -struct request *rq = tags->rqs[tag]; -/* mq_ctx of flush rq is always cloned from the corresponding req */ -struct blk_flush_queue *fq =blk_get_flush_queue (rq->q, rq->mq_ctx); - -if (!is_flush_request (rq, fq, tag)) -return rq; - -return fq->flush_rq; +return tags->rqs[tag]; }EXPORT_SYMBOL (blk_mq_tag_to_rq);
block/blk.h +6 -0
@@ -22,6 +22,12 @@ struct blk_flush_queue {struct list_head flush_queue[2 ];struct list_head flush_data_in_flight;struct request *flush_rq; + +/* +* flush_rq shares tag with this rq, both can't be active +* at the same time +*/ +struct request *orig_rq;spinlock_t mq_flush_lock; };
drivers/gpu/drm/msm/msm_gem_submit.c +5 -2
@@ -34,10 +34,13 @@ static inline void __user *to_user_ptr(u64 address) }static struct msm_gem_submit *submit_create (struct drm_device *dev, -struct msm_gpu *gpu,int nr) +struct msm_gpu *gpu,uint32_t nr) {struct msm_gem_submit *submit; -int sz =sizeof (*submit) + (nr *sizeof (submit->bos[0 ])); +uint64_t sz =sizeof (*submit) + ((u64 )nr *sizeof (submit->bos[0 ])); + +if (sz >SIZE_MAX ) +return NULL ; submit =kmalloc (sz,GFP_TEMPORARY | __GFP_NOWARN | __GFP_NORETRY);if (submit) {
drivers/i2c/busses/i2c-riic.c +23 -7
@@ -80,6 +80,7 @@#define ICIER_TEIE 0x40#define ICIER_RIE 0x20#define ICIER_NAKIE 0x10 +#define ICIER_SPIE 0x08#define ICSR2_NACKF 0x10
@@ -216,11 +217,10 @@ static irqreturn_t riic_tend_isr(int irq, void *data)return IRQ_NONE ; } -if (riic->is_last || riic->err) +if (riic->is_last || riic->err) { +riic_clear_set_bit (riic,0 ,ICIER_SPIE ,RIIC_ICIER );writeb (ICCR2_SP , riic->base +RIIC_ICCR2 ); - -writeb (0 , riic->base +RIIC_ICIER ); -complete (&riic->msg_done); + }return IRQ_HANDLED ; }
@@ -240,13 +240,13 @@ static irqreturn_t riic_rdrf_isr(int irq, void *data)if (riic->bytes_left ==1 ) {/* STOP must come before we set ACKBT! */ -if (riic->is_last) +if (riic->is_last) { +riic_clear_set_bit (riic,0 ,ICIER_SPIE ,RIIC_ICIER );writeb (ICCR2_SP , riic->base +RIIC_ICCR2 ); + }riic_clear_set_bit (riic,0 ,ICMR3_ACKBT ,RIIC_ICMR3 ); -writeb (0 , riic->base +RIIC_ICIER ); -complete (&riic->msg_done); }else {riic_clear_set_bit (riic,ICMR3_ACKBT ,0 ,RIIC_ICMR3 ); }
@@ -259,6 +259,21 @@ static irqreturn_t riic_rdrf_isr(int irq, void *data)return IRQ_HANDLED ; } +static irqreturn_t riic_stop_isr (int irq,void *data) +{ +struct riic_dev *riic = data; + +/* read back registers to confirm writes have fully propagated */ +writeb (0 , riic->base +RIIC_ICSR2 ); +readb (riic->base +RIIC_ICSR2 ); +writeb (0 , riic->base +RIIC_ICIER ); +readb (riic->base +RIIC_ICIER ); + +complete (&riic->msg_done); + +return IRQ_HANDLED ; +} +static u32 riic_func (struct i2c_adapter *adap) {return I2C_FUNC_I2C |I2C_FUNC_SMBUS_EMUL ;
@@ -326,6 +341,7 @@ static struct riic_irq_desc riic_irqs[] = { { .res_num = 0, .isr = riic_tend_isr, .name = "riic-tend" }, { .res_num = 1, .isr = riic_rdrf_isr, .name = "riic-rdrf" }, { .res_num = 2, .isr = riic_tdre_isr, .name = "riic-tdre" }, + { .res_num = 3, .isr = riic_stop_isr, .name = "riic-stop" }, { .res_num = 5, .isr = riic_tend_isr, .name = "riic-nack" }, };
drivers/media/pci/bt8xx/dvb-bt8xx.c +1 -0
@@ -680,6 +680,7 @@ static void frontend_init(struct dvb_bt8xx_card *card, u32 type)/* DST is not a frontend, attaching the ASIC */ if (dvb_attach (dst_attach, state, &card->dvb_adapter) ==NULL ) {pr_err ("%s: Could not find a Twinhan DST\n" , __func__); +kfree (state);break ; }/* Attach other DST peripherals if any */
drivers/media/usb/cx231xx/cx231xx-core.c +6 -1
@@ -365,7 +365,12 @@ int cx231xx_send_vendor_cmd(struct cx231xx *dev,*/ if ((ven_req->wLength >4 ) && ((ven_req->bRequest ==0x4 ) || (ven_req->bRequest ==0x5 ) || - (ven_req->bRequest ==0x6 ))) { + (ven_req->bRequest ==0x6 ) || + +/* Internal Master 3 Bus can send +* and receive only 4 bytes per time +*/ + (ven_req->bRequest ==0x2 ))) { unsend_size =0 ; pdata = ven_req->pBuff;
drivers/mmc/host/s3cmci.c +1 -0
@@ -21,6 +21,7 @@#include <linux/debugfs.h> #include <linux/seq_file.h> #include <linux/gpio.h> +#include <linux/interrupt.h> #include <linux/irq.h> #include <linux/io.h>
drivers/platform/x86/intel_mid_thermal.c +1 -0
@@ -551,6 +551,7 @@ static const struct platform_device_id therm_id_table[] = { { "msic_thermal", 1 }, { } }; +MODULE_DEVICE_TABLE(platform, therm_id_table); static struct platform_driver mid_thermal_driver = { .driver = {
drivers/s390/block/dasd.c +5 -2
@@ -1672,8 +1672,11 @@ void dasd_int_handler(struct ccw_device *cdev, unsigned long intparm,/* check for for attention message */ if (scsw_dstat (&irb->scsw) &DEV_STAT_ATTENTION ) { device =dasd_device_from_cdev_locked (cdev); - device->discipline->check_attention (device, irb->esw.esw1.lpum); -dasd_put_device (device); +if (!IS_ERR (device)) { + device->discipline->check_attention (device, + irb->esw.esw1.lpum); +dasd_put_device (device); + } }if (!cqr)
drivers/staging/lustre/lustre/include/lustre/lustre_user.h +8 -10
@@ -1066,23 +1066,21 @@ struct hsm_action_item {* \retval buffer */ static inline char *hai_dump_data_field (struct hsm_action_item *hai, -char *buffer,int len) +char *buffer,size_t len) { -int i, sz, data_len; +int i, data_len;char *ptr; ptr = buffer; - sz = len; data_len = hai->hai_len -sizeof (*hai); -for (i =0 ; (i < data_len) && (sz >0 ) ; i++) { -int cnt; - - cnt =snprintf (ptr, sz,"%.2X" , - (unsigned char )hai->hai_data[i]); - ptr += cnt; - sz -= cnt; +for (i =0 ; (i < data_len) && (len >2 ); i++) { +snprintf (ptr,3 ,"%02X" , (unsigned char )hai->hai_data[i]); + ptr +=2 ; + len -=2 ; } + *ptr ='\0' ; +return buffer; }
drivers/staging/lustre/lustre/ldlm/ldlm_lock.c +7 -0
@@ -573,6 +573,13 @@ struct ldlm_lock *__ldlm_handle2lock(const struct lustre_handle *handle,if (lock ==NULL )return NULL ; +if (lock->l_export && lock->l_export->exp_failed) { +CDEBUG (D_INFO ,"lock export failed: lock %p, exp %p\n" , + lock, lock->l_export); +LDLM_LOCK_PUT (lock); +return NULL ; + } +/* It's unlikely but possible that someone marked the lock as * destroyed after we did handle2object on it */ if (flags ==0 && ((lock->l_flags &LDLM_FL_DESTROYED )==0 )) {
drivers/staging/lustre/lustre/ptlrpc/service.c +8 -13
@@ -1506,20 +1506,15 @@ static int ptlrpc_server_hpreq_init(struct ptlrpc_service_part *svcpt,* it may hit swab race at LU-1044. */ if (req->rq_ops->hpreq_check) { rc = req->rq_ops->hpreq_check (req); -/** -* XXX: Out of all current -* ptlrpc_hpreq_ops::hpreq_check(), only -* ldlm_cancel_hpreq_check() can return an error code; -* other functions assert in similar places, which seems -* odd. What also does not seem right is that handlers -* for those RPCs do not assert on the same checks, but -* rather handle the error cases. e.g. see -* ost_rw_hpreq_check(), and ost_brw_read(), -* ost_brw_write(). +if (rc == -ESTALE ) { + req->rq_status = rc; +ptlrpc_error (req); + } +/** can only return error, +* 0 for normal request, +* or 1 for high priority request */ -if (rc <0 ) -return rc; -LASSERT (rc ==0 || rc ==1 ); +LASSERT (rc <=1 ); }spin_lock_bh (&req->rq_export->exp_rpc_lock);
drivers/staging/rtl8712/ieee80211.h +42 -42
157 lines not on this page · raw message
drivers/staging/rtl8712/rtl871x_xmit.c +4 -3
@@ -340,7 +340,8 @@ sint r8712_update_attrib(struct _adapter *padapter, _pkt *pkt,/* if in MP_STATE, update pkt_attrib from mp_txcmd, and overwrite * some settings above.*/ if (check_fwstate (pmlmepriv,WIFI_MP_STATE ) == true) - pattrib->priority = (txdesc.txdw1 >>QSEL_SHT ) &0x1f ; + pattrib->priority = + (le32_to_cpu (txdesc.txdw1) >>QSEL_SHT ) &0x1f ;return _SUCCESS; }
@@ -481,7 +482,7 @@ static sint make_wlanhdr(struct _adapter *padapter , u8 *hdr,struct ieee80211_hdr *pwlanhdr = (struct ieee80211_hdr *)hdr;struct mlme_priv *pmlmepriv = &padapter->mlmepriv;struct qos_priv *pqospriv = &pmlmepriv->qospriv; -u16 *fctrl = &pwlanhdr->frame_ctl; +__le16 *fctrl = &pwlanhdr->frame_ctl;memset (hdr,0 ,WLANHDR_OFFSET );SetFrameSubType (fctrl, pattrib->subtype);
@@ -569,7 +570,7 @@ static sint r8712_put_snap(u8 *data, u16 h_proto) snap->oui[0 ] = oui[0 ]; snap->oui[1 ] = oui[1 ]; snap->oui[2 ] = oui[2 ]; - *(u16 *)(data +SNAP_SIZE ) =htons (h_proto); + *(__be16 *)(data +SNAP_SIZE ) =htons (h_proto);return SNAP_SIZE +sizeof (u16); }
drivers/xen/manage.c +10 -2
@@ -272,8 +272,16 @@ static void sysrq_handler(struct xenbus_watch *watch, const char **vec, err =xenbus_transaction_start (&xbt);if (err)return ; -if (!xenbus_scanf (xbt,"control" ,"sysrq" ,"%c" , &sysrq_key)) { -pr_err ("Unable to read sysrq code in control/sysrq\n" ); + err =xenbus_scanf (xbt,"control" ,"sysrq" ,"%c" , &sysrq_key); +if (err <0 ) { +/* +* The Xenstore watch fires directly after registering it and +* after a suspend/resume cycle. So ENOENT is no error but +* might happen in those cases. +*/ +if (err != -ENOENT ) +pr_err ("Error %d reading sysrq code in control/sysrq\n" , + err);xenbus_transaction_end (xbt,1 );return ; }
fs/cifs/dir.c +3 -2
@@ -193,7 +193,8 @@ check_name(struct dentry *direntry, struct cifs_tcon *tcon)struct cifs_sb_info *cifs_sb =CIFS_SB (direntry->d_sb);int i; -if (unlikely (direntry->d_name.len > +if (unlikely (tcon->fsAttrInfo.MaxPathNameComponentLength && + direntry->d_name.len >le32_to_cpu (tcon->fsAttrInfo.MaxPathNameComponentLength)))return -ENAMETOOLONG ;
@@ -509,7 +510,7 @@ cifs_atomic_open(struct inode *inode, struct dentry *direntry, rc =check_name (direntry, tcon);if (rc) - goto out_free_xid; + goto out; server = tcon->ses->server;
fs/ext4/mballoc.c +4 -2
@@ -2113,8 +2113,10 @@ ext4_mb_regular_allocator(struct ext4_allocation_context *ac)* We search using buddy data only if the order of the request * is greater than equal to the sbi_s_mb_order2_reqs * You can tune it via /sys/fs/ext4/<partition>/mb_order2_req +* We also support searching for power-of-two requests only for +* requests upto maximum buddy size we have constructed. */ -if (i >= sbi->s_mb_order2_reqs) { +if (i >= sbi->s_mb_order2_reqs && i <= sb->s_blocksize_bits +2 ) {/* * This should tell if fe_len is exactly power of 2 */
@@ -2176,7 +2178,7 @@ repeat: } ac->ac_groups_scanned++; -if (cr ==0 && ac->ac_2order < sb->s_blocksize_bits+2 ) +if (cr ==0 )ext4_mb_simple_scan_group (ac, &e4b);else if (cr ==1 && sbi->s_stripe && !(ac->ac_g_ex.fe_len % sbi->s_stripe))
fs/ext4/super.c +2 -2
@@ -2441,9 +2441,9 @@ static unsigned long ext4_get_stripe_size(struct ext4_sb_info *sbi)if (sbi->s_stripe && sbi->s_stripe <= sbi->s_blocks_per_group) ret = sbi->s_stripe; -else if (stripe_width <= sbi->s_blocks_per_group) +else if (stripe_width && stripe_width <= sbi->s_blocks_per_group) ret = stripe_width; -else if (stride <= sbi->s_blocks_per_group) +else if (stride && stride <= sbi->s_blocks_per_group) ret = stride;else ret =0 ;
fs/ocfs2/alloc.c +18 -6
@@ -7235,13 +7235,24 @@ out:static int ocfs2_trim_extent (struct super_block *sb,struct ocfs2_group_desc *gd, -u32 start,u32 count) +u64 group,u32 start,u32 count) {u64 discard, bcount; +struct ocfs2_super *osb =OCFS2_SB (sb); bcount =ocfs2_clusters_to_blocks (sb, count); - discard =le64_to_cpu (gd->bg_blkno) + -ocfs2_clusters_to_blocks (sb, start); + discard =ocfs2_clusters_to_blocks (sb, start); + +/* +* For the first cluster group, the gd->bg_blkno is not at the start +* of the group, but at an offset from the start. If we add it while +* calculating discard for first group, we will wrongly start fstrim a +* few blocks after the desried start block and the range can cross +* over into the next cluster group. So, add it only if this is not +* the first cluster group. +*/ +if (group != osb->first_cluster_group_blkno) + discard +=le64_to_cpu (gd->bg_blkno);trace_ocfs2_trim_extent (sb, (unsigned long long )discard, bcount);
@@ -7249,7 +7260,7 @@ static int ocfs2_trim_extent(struct super_block *sb, }static int ocfs2_trim_group (struct super_block *sb, -struct ocfs2_group_desc *gd, +struct ocfs2_group_desc *gd,u64 group,u32 start,u32 max,u32 minbits) {int ret =0 , count =0 , next;
@@ -7268,7 +7279,7 @@ static int ocfs2_trim_group(struct super_block *sb, next =ocfs2_find_next_bit (bitmap, max, start);if ((next - start) >= minbits) { - ret =ocfs2_trim_extent (sb, gd, + ret =ocfs2_trim_extent (sb, gd, group, start, next - start);if (ret <0 ) {mlog_errno (ret);
@@ -7366,7 +7377,8 @@ int ocfs2_trim_fs(struct super_block *sb, struct fstrim_range *range) } gd = (struct ocfs2_group_desc *)gd_bh->b_data; - cnt =ocfs2_trim_group (sb, gd, first_bit, last_bit, minlen); + cnt =ocfs2_trim_group (sb, gd, group, + first_bit, last_bit, minlen);brelse (gd_bh); gd_bh =NULL ;if (cnt <0 ) {
lib/asn1_decoder.c +3 -0
@@ -276,6 +276,9 @@ next_op:if (unlikely (len > datalen - dp)) goto data_overrun_error; } + }else { +if (unlikely (len > datalen - dp)) + goto data_overrun_error; }if (flags &FLAG_CONS ) {
security/keys/keyring.c +19 -20
@@ -452,34 +452,33 @@ static long keyring_read(const struct key *keyring, char __user *buffer, size_t buflen) {struct keyring_read_iterator_context ctx; -unsigned long nr_keys; -int ret; +long ret;kenter ("{%d},,%zu" ,key_serial (keyring), buflen);if (buflen & (sizeof (key_serial_t) -1 ))return -EINVAL ; - nr_keys = keyring->keys.nr_leaves_on_tree; -if (nr_keys ==0 ) -return 0 ; - -/* Calculate how much data we could return */ -if (!buffer || !buflen) -return nr_keys *sizeof (key_serial_t); - -/* Copy the IDs of the subscribed keys into the buffer */ - ctx.buffer = (key_serial_t __user *)buffer; - ctx.buflen = buflen; - ctx.count =0 ; - ret =assoc_array_iterate (&keyring->keys, keyring_read_iterator, &ctx); -if (ret <0 ) { -kleave (" = %d [iterate]" , ret); -return ret; +/* Copy as many key IDs as fit into the buffer */ +if (buffer && buflen) { + ctx.buffer = (key_serial_t __user *)buffer; + ctx.buflen = buflen; + ctx.count =0 ; + ret =assoc_array_iterate (&keyring->keys, + keyring_read_iterator, &ctx); +if (ret <0 ) { +kleave (" = %ld [iterate]" , ret); +return ret; + } } -kleave (" = %zu [ok]" , ctx.count); -return ctx.count; +/* Return the size of the buffer needed */ + ret = keyring->keys.nr_leaves_on_tree *sizeof (key_serial_t); +if (ret <= buflen) +kleave ("= %ld [ok]" , ret); +else +kleave ("= %ld [buffer too small]" , ret); +return ret; }/*
sound/core/seq/seq_clientmgr.c +1 -1
@@ -676,7 +676,7 @@ static int deliver_to_subscribers(struct snd_seq_client *client,if (atomic)read_lock (&grp->list_lock);else -down_read (&grp->list_mutex); +down_read_nested (&grp->list_mutex, hop);list_for_each_entry (subs, &grp->list_head, src_list) {/* both ports ready? */ if (atomic_read (&subs->ref_count) !=2 )
sound/core/timer_compat.c +15 -2
@@ -106,7 +106,8 @@ enum {#endif /* CONFIG_X86_X32 */ }; -static long snd_timer_user_ioctl_compat (struct file *file,unsigned int cmd,unsigned long arg) +static long __snd_timer_user_ioctl_compat (struct file *file,unsigned int cmd, +unsigned long arg) {void __user *argp =compat_ptr (arg);
@@ -127,7 +128,7 @@ static long snd_timer_user_ioctl_compat(struct file *file, unsigned int cmd, unscase SNDRV_TIMER_IOCTL_PAUSE :case SNDRV_TIMER_IOCTL_PAUSE_OLD :case SNDRV_TIMER_IOCTL_NEXT_DEVICE : -return snd_timer_user_ioctl (file, cmd, (unsigned long )argp); +return __snd_timer_user_ioctl (file, cmd, (unsigned long )argp);case SNDRV_TIMER_IOCTL_INFO32 :return snd_timer_user_info_compat (file, argp);case SNDRV_TIMER_IOCTL_STATUS32 :
@@ -139,3 +140,15 @@ static long snd_timer_user_ioctl_compat(struct file *file, unsigned int cmd, uns }return -ENOIOCTLCMD ; } + +static long snd_timer_user_ioctl_compat (struct file *file,unsigned int cmd, +unsigned long arg) +{ +struct snd_timer_user *tu = file->private_data; +long ret; + +mutex_lock (&tu->ioctl_lock); + ret =__snd_timer_user_ioctl_compat (file, cmd, arg); +mutex_unlock (&tu->ioctl_lock); +return ret; +}
sound/soc/codecs/adau17x1.c +23 -1
@@ -88,6 +88,27 @@ static int adau17x1_pll_event(struct snd_soc_dapm_widget *w,return 0 ; } +static int adau17x1_adc_fixup (struct snd_soc_dapm_widget *w, +struct snd_kcontrol *kcontrol,int event) +{ +struct snd_soc_codec *codec =snd_soc_dapm_to_codec (w->dapm); +struct adau *adau =snd_soc_codec_get_drvdata (codec); + +/* +* If we are capturing, toggle the ADOSR bit in Converter Control 0 to +* avoid losing SNR (workaround from ADI). This must be done after +* the ADC(s) have been enabled. According to the data sheet, it is +* normally illegal to set this bit when the sampling rate is 96 kHz, +* but according to ADI it is acceptable for this workaround. +*/ +regmap_update_bits (adau->regmap,ADAU17X1_CONVERTER0 , +ADAU17X1_CONVERTER0_ADOSR ,ADAU17X1_CONVERTER0_ADOSR ); +regmap_update_bits (adau->regmap,ADAU17X1_CONVERTER0 , +ADAU17X1_CONVERTER0_ADOSR ,0 ); + +return 0 ; +} +static const char *const adau17x1_mono_stereo_text[] = {"Stereo" ,"Mono Left Channel (L+R)" ,
@@ -119,7 +140,8 @@ static const struct snd_soc_dapm_widget adau17x1_dapm_widgets[] = {SND_SOC_DAPM_MUX ("Right DAC Mode Mux" ,SND_SOC_NOPM ,0 ,0 , &adau17x1_dac_mode_mux), -SND_SOC_DAPM_ADC ("Left Decimator" ,NULL ,ADAU17X1_ADC_CONTROL ,0 ,0 ), +SND_SOC_DAPM_ADC_E ("Left Decimator" ,NULL ,ADAU17X1_ADC_CONTROL ,0 ,0 , + adau17x1_adc_fixup,SND_SOC_DAPM_POST_PMU ),SND_SOC_DAPM_ADC ("Right Decimator" ,NULL ,ADAU17X1_ADC_CONTROL ,1 ,0 ),SND_SOC_DAPM_DAC ("Left DAC" ,NULL ,ADAU17X1_DAC_CONTROL0 ,0 ,0 ), SND_SOC_DAPM_DAC("Right DAC", NULL, ADAU17X1_DAC_CONTROL0, 1, 0),
sound/soc/codecs/adau17x1.h +2 -0
@@ -119,5 +119,7 @@ bool adau17x1_has_dsp(struct adau *adau);#define ADAU17X1_CONVERTER0_CONVSR_MASK 0x7 +#define ADAU17X1_CONVERTER0_ADOSR BIT(3) +#endif