Magellan Linux

Annotation of /trunk/kernel-lts/patches-3.4/0153-3.4.54-all-fixes.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2264 - (hide annotations) (download)
Mon Aug 19 09:33:43 2013 UTC (10 years, 8 months ago) by niro
File size: 19714 byte(s)
-fixed patches
1 niro 2258 diff --git a/arch/arm/kernel/perf_event.c b/arch/arm/kernel/perf_event.c
2     index 85d6332..a99ed7a 100644
3     --- a/arch/arm/kernel/perf_event.c
4     +++ b/arch/arm/kernel/perf_event.c
5     @@ -824,6 +824,7 @@ perf_callchain_user(struct perf_callchain_entry *entry, struct pt_regs *regs)
6     struct frame_tail __user *tail;
7    
8    
9     + perf_callchain_store(entry, regs->ARM_pc);
10     tail = (struct frame_tail __user *)regs->ARM_fp - 1;
11    
12     while ((entry->nr < PERF_MAX_STACK_DEPTH) &&
13     diff --git a/arch/x86/xen/time.c b/arch/x86/xen/time.c
14     index 054cc01..d50a821 100644
15     --- a/arch/x86/xen/time.c
16     +++ b/arch/x86/xen/time.c
17     @@ -36,9 +36,8 @@ static DEFINE_PER_CPU(struct vcpu_runstate_info, xen_runstate);
18     /* snapshots of runstate info */
19     static DEFINE_PER_CPU(struct vcpu_runstate_info, xen_runstate_snapshot);
20    
21     -/* unused ns of stolen and blocked time */
22     +/* unused ns of stolen time */
23     static DEFINE_PER_CPU(u64, xen_residual_stolen);
24     -static DEFINE_PER_CPU(u64, xen_residual_blocked);
25    
26     /* return an consistent snapshot of 64-bit time/counter value */
27     static u64 get64(const u64 *p)
28     @@ -115,7 +114,7 @@ static void do_stolen_accounting(void)
29     {
30     struct vcpu_runstate_info state;
31     struct vcpu_runstate_info *snap;
32     - s64 blocked, runnable, offline, stolen;
33     + s64 runnable, offline, stolen;
34     cputime_t ticks;
35    
36     get_runstate_snapshot(&state);
37     @@ -125,7 +124,6 @@ static void do_stolen_accounting(void)
38     snap = &__get_cpu_var(xen_runstate_snapshot);
39    
40     /* work out how much time the VCPU has not been runn*ing* */
41     - blocked = state.time[RUNSTATE_blocked] - snap->time[RUNSTATE_blocked];
42     runnable = state.time[RUNSTATE_runnable] - snap->time[RUNSTATE_runnable];
43     offline = state.time[RUNSTATE_offline] - snap->time[RUNSTATE_offline];
44    
45     @@ -141,17 +139,6 @@ static void do_stolen_accounting(void)
46     ticks = iter_div_u64_rem(stolen, NS_PER_TICK, &stolen);
47     __this_cpu_write(xen_residual_stolen, stolen);
48     account_steal_ticks(ticks);
49     -
50     - /* Add the appropriate number of ticks of blocked time,
51     - including any left-overs from last time. */
52     - blocked += __this_cpu_read(xen_residual_blocked);
53     -
54     - if (blocked < 0)
55     - blocked = 0;
56     -
57     - ticks = iter_div_u64_rem(blocked, NS_PER_TICK, &blocked);
58     - __this_cpu_write(xen_residual_blocked, blocked);
59     - account_idle_ticks(ticks);
60     }
61    
62     /* Get the TSC speed from Xen */
63     diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
64     index f9914e5..3251d4b 100644
65     --- a/drivers/acpi/ec.c
66     +++ b/drivers/acpi/ec.c
67     @@ -974,6 +974,10 @@ static struct dmi_system_id __initdata ec_dmi_table[] = {
68     ec_enlarge_storm_threshold, "CLEVO hardware", {
69     DMI_MATCH(DMI_SYS_VENDOR, "CLEVO Co."),
70     DMI_MATCH(DMI_PRODUCT_NAME, "M720T/M730T"),}, NULL},
71     + {
72     + ec_skip_dsdt_scan, "HP Folio 13", {
73     + DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
74     + DMI_MATCH(DMI_PRODUCT_NAME, "HP Folio 13"),}, NULL},
75     {},
76     };
77    
78     diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
79     index 71a4d04..aeb8220 100644
80     --- a/drivers/ata/ahci.c
81     +++ b/drivers/ata/ahci.c
82     @@ -284,6 +284,7 @@ static const struct pci_device_id ahci_pci_tbl[] = {
83    
84     /* AMD */
85     { PCI_VDEVICE(AMD, 0x7800), board_ahci }, /* AMD Hudson-2 */
86     + { PCI_VDEVICE(AMD, 0x7900), board_ahci }, /* AMD CZ */
87     /* AMD is using RAID class only for ahci controllers */
88     { PCI_VENDOR_ID_AMD, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
89     PCI_CLASS_STORAGE_RAID << 8, 0xffffff, board_ahci },
90     diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c
91     index f9eaa82..47a1fb8 100644
92     --- a/drivers/ata/libahci.c
93     +++ b/drivers/ata/libahci.c
94     @@ -1543,8 +1543,7 @@ static void ahci_error_intr(struct ata_port *ap, u32 irq_stat)
95     u32 fbs = readl(port_mmio + PORT_FBS);
96     int pmp = fbs >> PORT_FBS_DWE_OFFSET;
97    
98     - if ((fbs & PORT_FBS_SDE) && (pmp < ap->nr_pmp_links) &&
99     - ata_link_online(&ap->pmp_link[pmp])) {
100     + if ((fbs & PORT_FBS_SDE) && (pmp < ap->nr_pmp_links)) {
101     link = &ap->pmp_link[pmp];
102     fbs_need_dec = true;
103     }
104     diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
105     index 758122f..15a6af8 100644
106     --- a/drivers/dma/pl330.c
107     +++ b/drivers/dma/pl330.c
108     @@ -2469,10 +2469,10 @@ static void pl330_free_chan_resources(struct dma_chan *chan)
109     struct dma_pl330_chan *pch = to_pchan(chan);
110     unsigned long flags;
111    
112     - spin_lock_irqsave(&pch->lock, flags);
113     -
114     tasklet_kill(&pch->task);
115    
116     + spin_lock_irqsave(&pch->lock, flags);
117     +
118     pl330_release_channel(pch->pl330_chid);
119     pch->pl330_chid = NULL;
120    
121     diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/rf.c b/drivers/net/wireless/rtlwifi/rtl8192cu/rf.c
122     index 506b9a0..4763426 100644
123     --- a/drivers/net/wireless/rtlwifi/rtl8192cu/rf.c
124     +++ b/drivers/net/wireless/rtlwifi/rtl8192cu/rf.c
125     @@ -104,7 +104,7 @@ void rtl92cu_phy_rf6052_set_cck_txpower(struct ieee80211_hw *hw,
126     tx_agc[RF90_PATH_A] = 0x10101010;
127     tx_agc[RF90_PATH_B] = 0x10101010;
128     } else if (rtlpriv->dm.dynamic_txhighpower_lvl ==
129     - TXHIGHPWRLEVEL_LEVEL1) {
130     + TXHIGHPWRLEVEL_LEVEL2) {
131     tx_agc[RF90_PATH_A] = 0x00000000;
132     tx_agc[RF90_PATH_B] = 0x00000000;
133     } else{
134     diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
135     index 8cf41bb..3f869c9 100644
136     --- a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
137     +++ b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
138     @@ -357,6 +357,7 @@ static struct usb_device_id rtl8192c_usb_ids[] = {
139     {RTL_USB_DEVICE(0x2001, 0x330a, rtl92cu_hal_cfg)}, /*D-Link-Alpha*/
140     {RTL_USB_DEVICE(0x2019, 0xab2b, rtl92cu_hal_cfg)}, /*Planex -Abocom*/
141     {RTL_USB_DEVICE(0x20f4, 0x624d, rtl92cu_hal_cfg)}, /*TRENDNet*/
142     + {RTL_USB_DEVICE(0x2357, 0x0100, rtl92cu_hal_cfg)}, /*TP-Link WN8200ND*/
143     {RTL_USB_DEVICE(0x7392, 0x7822, rtl92cu_hal_cfg)}, /*Edimax -Edimax*/
144     {}
145     };
146     diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
147     index 680dbfa..103c95e 100644
148     --- a/drivers/pci/quirks.c
149     +++ b/drivers/pci/quirks.c
150     @@ -1062,6 +1062,8 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP700_SATA, quirk
151     DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP700_SATA, quirk_amd_ide_mode);
152     DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_HUDSON2_SATA_IDE, quirk_amd_ide_mode);
153     DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_HUDSON2_SATA_IDE, quirk_amd_ide_mode);
154     +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, 0x7900, quirk_amd_ide_mode);
155     +DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_AMD, 0x7900, quirk_amd_ide_mode);
156    
157     /*
158     * Serverworks CSB5 IDE does not fully support native mode
159     diff --git a/drivers/pcmcia/at91_cf.c b/drivers/pcmcia/at91_cf.c
160     index 9694c1e..fc50168 100644
161     --- a/drivers/pcmcia/at91_cf.c
162     +++ b/drivers/pcmcia/at91_cf.c
163     @@ -100,9 +100,9 @@ static int at91_cf_get_status(struct pcmcia_socket *s, u_int *sp)
164     int vcc = gpio_is_valid(cf->board->vcc_pin);
165    
166     *sp = SS_DETECT | SS_3VCARD;
167     - if (!rdy || gpio_get_value(rdy))
168     + if (!rdy || gpio_get_value(cf->board->irq_pin))
169     *sp |= SS_READY;
170     - if (!vcc || gpio_get_value(vcc))
171     + if (!vcc || gpio_get_value(cf->board->vcc_pin))
172     *sp |= SS_POWERON;
173     } else
174     *sp = 0;
175     diff --git a/drivers/rtc/rtc-rv3029c2.c b/drivers/rtc/rtc-rv3029c2.c
176     index 0fbe57b..21d63d1 100644
177     --- a/drivers/rtc/rtc-rv3029c2.c
178     +++ b/drivers/rtc/rtc-rv3029c2.c
179     @@ -310,7 +310,7 @@ static int rv3029c2_rtc_i2c_set_alarm(struct i2c_client *client,
180     dev_dbg(&client->dev, "alarm IRQ armed\n");
181     } else {
182     /* disable AIE irq */
183     - ret = rv3029c2_rtc_i2c_alarm_set_irq(client, 1);
184     + ret = rv3029c2_rtc_i2c_alarm_set_irq(client, 0);
185     if (ret)
186     return ret;
187    
188     diff --git a/drivers/usb/gadget/f_mass_storage.c b/drivers/usb/gadget/f_mass_storage.c
189     index cb8c162..6de5760 100644
190     --- a/drivers/usb/gadget/f_mass_storage.c
191     +++ b/drivers/usb/gadget/f_mass_storage.c
192     @@ -511,6 +511,7 @@ static int fsg_set_halt(struct fsg_dev *fsg, struct usb_ep *ep)
193     /* Caller must hold fsg->lock */
194     static void wakeup_thread(struct fsg_common *common)
195     {
196     + smp_wmb(); /* ensure the write of bh->state is complete */
197     /* Tell the main thread that something has happened */
198     common->thread_wakeup_needed = 1;
199     if (common->thread_task)
200     @@ -730,6 +731,7 @@ static int sleep_thread(struct fsg_common *common)
201     }
202     __set_current_state(TASK_RUNNING);
203     common->thread_wakeup_needed = 0;
204     + smp_rmb(); /* ensure the latest bh->state is visible */
205     return rc;
206     }
207    
208     diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
209     index 5080b1d..3347e9b 100644
210     --- a/drivers/usb/host/xhci-mem.c
211     +++ b/drivers/usb/host/xhci-mem.c
212     @@ -369,6 +369,10 @@ static struct xhci_container_ctx *xhci_alloc_container_ctx(struct xhci_hcd *xhci
213     ctx->size += CTX_SIZE(xhci->hcc_params);
214    
215     ctx->bytes = dma_pool_alloc(xhci->device_pool, flags, &ctx->dma);
216     + if (!ctx->bytes) {
217     + kfree(ctx);
218     + return NULL;
219     + }
220     memset(ctx->bytes, 0, ctx->size);
221     return ctx;
222     }
223     diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
224     index df90fe5..93ad67e 100644
225     --- a/drivers/usb/host/xhci-plat.c
226     +++ b/drivers/usb/host/xhci-plat.c
227     @@ -179,6 +179,7 @@ static int xhci_plat_remove(struct platform_device *dev)
228    
229     usb_remove_hcd(hcd);
230     iounmap(hcd->regs);
231     + release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
232     usb_put_hcd(hcd);
233     kfree(xhci);
234    
235     diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
236     index 5b24260..33e20e4 100644
237     --- a/drivers/usb/serial/option.c
238     +++ b/drivers/usb/serial/option.c
239     @@ -159,8 +159,6 @@ static void option_instat_callback(struct urb *urb);
240     #define NOVATELWIRELESS_PRODUCT_HSPA_EMBEDDED_FULLSPEED 0x9000
241     #define NOVATELWIRELESS_PRODUCT_HSPA_EMBEDDED_HIGHSPEED 0x9001
242     #define NOVATELWIRELESS_PRODUCT_E362 0x9010
243     -#define NOVATELWIRELESS_PRODUCT_G1 0xA001
244     -#define NOVATELWIRELESS_PRODUCT_G1_M 0xA002
245     #define NOVATELWIRELESS_PRODUCT_G2 0xA010
246     #define NOVATELWIRELESS_PRODUCT_MC551 0xB001
247    
248     @@ -744,8 +742,6 @@ static const struct usb_device_id option_ids[] = {
249     { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC547) },
250     { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EVDO_EMBEDDED_HIGHSPEED) },
251     { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_EMBEDDED_HIGHSPEED) },
252     - { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_G1) },
253     - { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_G1_M) },
254     { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_G2) },
255     /* Novatel Ovation MC551 a.k.a. Verizon USB551L */
256     { USB_DEVICE_AND_INTERFACE_INFO(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC551, 0xff, 0xff, 0xff) },
257     diff --git a/drivers/usb/serial/qcserial.c b/drivers/usb/serial/qcserial.c
258     index d46277d..c7ccbc6 100644
259     --- a/drivers/usb/serial/qcserial.c
260     +++ b/drivers/usb/serial/qcserial.c
261     @@ -37,7 +37,13 @@ static const struct usb_device_id id_table[] = {
262     {DEVICE_G1K(0x04da, 0x250c)}, /* Panasonic Gobi QDL device */
263     {DEVICE_G1K(0x413c, 0x8172)}, /* Dell Gobi Modem device */
264     {DEVICE_G1K(0x413c, 0x8171)}, /* Dell Gobi QDL device */
265     - {DEVICE_G1K(0x1410, 0xa001)}, /* Novatel Gobi Modem device */
266     + {DEVICE_G1K(0x1410, 0xa001)}, /* Novatel/Verizon USB-1000 */
267     + {DEVICE_G1K(0x1410, 0xa002)}, /* Novatel Gobi Modem device */
268     + {DEVICE_G1K(0x1410, 0xa003)}, /* Novatel Gobi Modem device */
269     + {DEVICE_G1K(0x1410, 0xa004)}, /* Novatel Gobi Modem device */
270     + {DEVICE_G1K(0x1410, 0xa005)}, /* Novatel Gobi Modem device */
271     + {DEVICE_G1K(0x1410, 0xa006)}, /* Novatel Gobi Modem device */
272     + {DEVICE_G1K(0x1410, 0xa007)}, /* Novatel Gobi Modem device */
273     {DEVICE_G1K(0x1410, 0xa008)}, /* Novatel Gobi QDL device */
274     {DEVICE_G1K(0x0b05, 0x1776)}, /* Asus Gobi Modem device */
275     {DEVICE_G1K(0x0b05, 0x1774)}, /* Asus Gobi QDL device */
276     diff --git a/fs/cifs/cifs_unicode.h b/fs/cifs/cifs_unicode.h
277     index a513a54..f2b2ffd 100644
278     --- a/fs/cifs/cifs_unicode.h
279     +++ b/fs/cifs/cifs_unicode.h
280     @@ -323,14 +323,14 @@ UniToupper(register wchar_t uc)
281     /*
282     * UniStrupr: Upper case a unicode string
283     */
284     -static inline wchar_t *
285     -UniStrupr(register wchar_t *upin)
286     +static inline __le16 *
287     +UniStrupr(register __le16 *upin)
288     {
289     - register wchar_t *up;
290     + register __le16 *up;
291    
292     up = upin;
293     while (*up) { /* For all characters */
294     - *up = UniToupper(*up);
295     + *up = cpu_to_le16(UniToupper(le16_to_cpu(*up)));
296     up++;
297     }
298     return upin; /* Return input pointer */
299     diff --git a/fs/cifs/cifsencrypt.c b/fs/cifs/cifsencrypt.c
300     index 63c460e..6d0c62a 100644
301     --- a/fs/cifs/cifsencrypt.c
302     +++ b/fs/cifs/cifsencrypt.c
303     @@ -394,7 +394,7 @@ static int calc_ntlmv2_hash(struct cifs_ses *ses, char *ntlmv2_hash,
304     int rc = 0;
305     int len;
306     char nt_hash[CIFS_NTHASH_SIZE];
307     - wchar_t *user;
308     + __le16 *user;
309     wchar_t *domain;
310     wchar_t *server;
311    
312     @@ -419,7 +419,7 @@ static int calc_ntlmv2_hash(struct cifs_ses *ses, char *ntlmv2_hash,
313     return rc;
314     }
315    
316     - /* convert ses->user_name to unicode and uppercase */
317     + /* convert ses->user_name to unicode */
318     len = ses->user_name ? strlen(ses->user_name) : 0;
319     user = kmalloc(2 + (len * 2), GFP_KERNEL);
320     if (user == NULL) {
321     @@ -429,7 +429,7 @@ static int calc_ntlmv2_hash(struct cifs_ses *ses, char *ntlmv2_hash,
322     }
323    
324     if (len) {
325     - len = cifs_strtoUTF16((__le16 *)user, ses->user_name, len, nls_cp);
326     + len = cifs_strtoUTF16(user, ses->user_name, len, nls_cp);
327     UniStrupr(user);
328     } else {
329     memset(user, '\0', 2);
330     diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
331     index 6fbfbdb..43944c6 100644
332     --- a/fs/cifs/inode.c
333     +++ b/fs/cifs/inode.c
334     @@ -549,6 +549,11 @@ cifs_all_info_to_fattr(struct cifs_fattr *fattr, FILE_ALL_INFO *info,
335     fattr->cf_mode &= ~(S_IWUGO);
336    
337     fattr->cf_nlink = le32_to_cpu(info->NumberOfLinks);
338     + if (fattr->cf_nlink < 1) {
339     + cFYI(1, "replacing bogus file nlink value %u\n",
340     + fattr->cf_nlink);
341     + fattr->cf_nlink = 1;
342     + }
343     }
344    
345     fattr->cf_uid = cifs_sb->mnt_uid;
346     diff --git a/fs/ext3/namei.c b/fs/ext3/namei.c
347     index d7940b2..fbb9b82 100644
348     --- a/fs/ext3/namei.c
349     +++ b/fs/ext3/namei.c
350     @@ -573,11 +573,8 @@ static int htree_dirblock_to_tree(struct file *dir_file,
351     if (!ext3_check_dir_entry("htree_dirblock_to_tree", dir, de, bh,
352     (block<<EXT3_BLOCK_SIZE_BITS(dir->i_sb))
353     +((char *)de - bh->b_data))) {
354     - /* On error, skip the f_pos to the next block. */
355     - dir_file->f_pos = (dir_file->f_pos |
356     - (dir->i_sb->s_blocksize - 1)) + 1;
357     - brelse (bh);
358     - return count;
359     + /* silently ignore the rest of the block */
360     + break;
361     }
362     ext3fs_dirhash(de->name, de->name_len, hinfo);
363     if ((hinfo->hash < start_hash) ||
364     diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
365     index 0efff1e..b9a3726 100644
366     --- a/fs/ext4/extents.c
367     +++ b/fs/ext4/extents.c
368     @@ -4713,7 +4713,7 @@ static int ext4_xattr_fiemap(struct inode *inode,
369     error = ext4_get_inode_loc(inode, &iloc);
370     if (error)
371     return error;
372     - physical = iloc.bh->b_blocknr << blockbits;
373     + physical = (__u64)iloc.bh->b_blocknr << blockbits;
374     offset = EXT4_GOOD_OLD_INODE_SIZE +
375     EXT4_I(inode)->i_extra_isize;
376     physical += offset;
377     @@ -4721,7 +4721,7 @@ static int ext4_xattr_fiemap(struct inode *inode,
378     flags |= FIEMAP_EXTENT_DATA_INLINE;
379     brelse(iloc.bh);
380     } else { /* external block */
381     - physical = EXT4_I(inode)->i_file_acl << blockbits;
382     + physical = (__u64)EXT4_I(inode)->i_file_acl << blockbits;
383     length = inode->i_sb->s_blocksize;
384     }
385    
386     diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
387     index 2857e5b..98bff01ee 100644
388     --- a/fs/ext4/inode.c
389     +++ b/fs/ext4/inode.c
390     @@ -4221,7 +4221,7 @@ int ext4_getattr(struct vfsmount *mnt, struct dentry *dentry,
391     struct kstat *stat)
392     {
393     struct inode *inode;
394     - unsigned long delalloc_blocks;
395     + unsigned long long delalloc_blocks;
396    
397     inode = dentry->d_inode;
398     generic_fillattr(inode, stat);
399     @@ -4238,7 +4238,7 @@ int ext4_getattr(struct vfsmount *mnt, struct dentry *dentry,
400     */
401     delalloc_blocks = EXT4_I(inode)->i_reserved_data_blocks;
402    
403     - stat->blocks += (delalloc_blocks << inode->i_sb->s_blocksize_bits)>>9;
404     + stat->blocks += delalloc_blocks << (inode->i_sb->s_blocksize_bits-9);
405     return 0;
406     }
407    
408     diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
409     index 19e4518..8784842 100644
410     --- a/fs/ext4/mballoc.c
411     +++ b/fs/ext4/mballoc.c
412     @@ -4639,11 +4639,16 @@ do_more:
413     * blocks being freed are metadata. these blocks shouldn't
414     * be used until this transaction is committed
415     */
416     + retry:
417     new_entry = kmem_cache_alloc(ext4_free_data_cachep, GFP_NOFS);
418     if (!new_entry) {
419     - ext4_mb_unload_buddy(&e4b);
420     - err = -ENOMEM;
421     - goto error_return;
422     + /*
423     + * We use a retry loop because
424     + * ext4_free_blocks() is not allowed to fail.
425     + */
426     + cond_resched();
427     + congestion_wait(BLK_RW_ASYNC, HZ/50);
428     + goto retry;
429     }
430     new_entry->efd_start_cluster = bit;
431     new_entry->efd_group = block_group;
432     diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
433     index ac76939..9fb3fae 100644
434     --- a/fs/ext4/namei.c
435     +++ b/fs/ext4/namei.c
436     @@ -585,11 +585,8 @@ static int htree_dirblock_to_tree(struct file *dir_file,
437     if (ext4_check_dir_entry(dir, NULL, de, bh,
438     (block<<EXT4_BLOCK_SIZE_BITS(dir->i_sb))
439     + ((char *)de - bh->b_data))) {
440     - /* On error, skip the f_pos to the next block. */
441     - dir_file->f_pos = (dir_file->f_pos |
442     - (dir->i_sb->s_blocksize - 1)) + 1;
443     - brelse(bh);
444     - return count;
445     + /* silently ignore the rest of the block */
446     + break;
447     }
448     ext4fs_dirhash(de->name, de->name_len, hinfo);
449     if ((hinfo->hash < start_hash) ||
450     diff --git a/fs/jbd2/transaction.c b/fs/jbd2/transaction.c
451     index 6075ac03..f567127 100644
452     --- a/fs/jbd2/transaction.c
453     +++ b/fs/jbd2/transaction.c
454     @@ -500,10 +500,10 @@ int jbd2__journal_restart(handle_t *handle, int nblocks, gfp_t gfp_mask)
455     &transaction->t_outstanding_credits);
456     if (atomic_dec_and_test(&transaction->t_updates))
457     wake_up(&journal->j_wait_updates);
458     + tid = transaction->t_tid;
459     spin_unlock(&transaction->t_handle_lock);
460    
461     jbd_debug(2, "restarting handle %p\n", handle);
462     - tid = transaction->t_tid;
463     need_to_start = !tid_geq(journal->j_commit_request, tid);
464     read_unlock(&journal->j_state_lock);
465     if (need_to_start)
466     diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c
467     index 2e3ea30..5b8d944 100644
468     --- a/fs/ocfs2/xattr.c
469     +++ b/fs/ocfs2/xattr.c
470     @@ -6499,6 +6499,16 @@ static int ocfs2_reflink_xattr_inline(struct ocfs2_xattr_reflink *args)
471     }
472    
473     new_oi = OCFS2_I(args->new_inode);
474     + /*
475     + * Adjust extent record count to reserve space for extended attribute.
476     + * Inline data count had been adjusted in ocfs2_duplicate_inline_data().
477     + */
478     + if (!(new_oi->ip_dyn_features & OCFS2_INLINE_DATA_FL) &&
479     + !(ocfs2_inode_is_fast_symlink(args->new_inode))) {
480     + struct ocfs2_extent_list *el = &new_di->id2.i_list;
481     + le16_add_cpu(&el->l_count, -(inline_size /
482     + sizeof(struct ocfs2_extent_rec)));
483     + }
484     spin_lock(&new_oi->ip_lock);
485     new_oi->ip_dyn_features |= OCFS2_HAS_XATTR_FL | OCFS2_INLINE_XATTR_FL;
486     new_di->i_dyn_features = cpu_to_le16(new_oi->ip_dyn_features);
487     diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
488     index 7684920..86a500d 100644
489     --- a/kernel/irq/manage.c
490     +++ b/kernel/irq/manage.c
491     @@ -546,9 +546,9 @@ int can_request_irq(unsigned int irq, unsigned long irqflags)
492     return 0;
493    
494     if (irq_settings_can_request(desc)) {
495     - if (desc->action)
496     - if (irqflags & desc->action->flags & IRQF_SHARED)
497     - canrequest =1;
498     + if (!desc->action ||
499     + irqflags & desc->action->flags & IRQF_SHARED)
500     + canrequest = 1;
501     }
502     irq_put_desc_unlock(desc, flags);
503     return canrequest;
504     diff --git a/kernel/timer.c b/kernel/timer.c
505     index dd93d90..7e0a770 100644
506     --- a/kernel/timer.c
507     +++ b/kernel/timer.c
508     @@ -145,9 +145,11 @@ static unsigned long round_jiffies_common(unsigned long j, int cpu,
509     /* now that we have rounded, subtract the extra skew again */
510     j -= cpu * 3;
511    
512     - if (j <= jiffies) /* rounding ate our timeout entirely; */
513     - return original;
514     - return j;
515     + /*
516     + * Make sure j is still in the future. Otherwise return the
517     + * unmodified value.
518     + */
519     + return time_is_after_jiffies(j) ? j : original;
520     }
521    
522     /**