Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


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