aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2012-02-16i387: move TS_USEDFPU clearing out of __save_init_fpu and into callersLinus Torvalds1-3/+6
Touching TS_USEDFPU without touching CR0.TS is confusing, so don't do it. By moving it into the callers, we always do the TS_USEDFPU next to the CR0.TS accesses in the source code, and it's much easier to see how the two go hand in hand. Signed-off-by: Linus Torvalds <[email protected]>
2012-02-16i387: fix x86-64 preemption-unsafe user stack save/restoreLinus Torvalds3-8/+45
Commit 5b1cbac37798 ("i387: make irq_fpu_usable() tests more robust") added a sanity check to the #NM handler to verify that we never cause the "Device Not Available" exception in kernel mode. However, that check actually pinpointed a (fundamental) race where we do cause that exception as part of the signal stack FPU state save/restore code. Because we use the floating point instructions themselves to save and restore state directly from user mode, we cannot do that atomically with testing the TS_USEDFPU bit: the user mode access itself may cause a page fault, which causes a task switch, which saves and restores the FP/MMX state from the kernel buffers. This kind of "recursive" FP state save is fine per se, but it means that when the signal stack save/restore gets restarted, it will now take the '#NM' exception we originally tried to avoid. With preemption this can happen even without the page fault - but because of the user access, we cannot just disable preemption around the save/restore instruction. There are various ways to solve this, including using the "enable/disable_page_fault()" helpers to not allow page faults at all during the sequence, and fall back to copying things by hand without the use of the native FP state save/restore instructions. However, the simplest thing to do is to just allow the #NM from kernel space, but fix the race in setting and clearing CR0.TS that this all exposed: the TS bit changes and the TS_USEDFPU bit absolutely have to be atomic wrt scheduling, so while the actual state save/restore can be interrupted and restarted, the act of actually clearing/setting CR0.TS and the TS_USEDFPU bit together must not. Instead of just adding random "preempt_disable/enable()" calls to what is already excessively ugly code, this introduces some helper functions that mostly mirror the "kernel_fpu_begin/end()" functionality, just for the user state instead. Those helper functions should probably eventually replace the other ad-hoc CR0.TS and TS_USEDFPU tests too, but I'll need to think about it some more: the task switching functionality in particular needs to expose the difference between the 'prev' and 'next' threads, while the new helper functions intentionally were written to only work with 'current'. Signed-off-by: Linus Torvalds <[email protected]>
2012-02-16Btrfs: fix a bug on overcommit stuffLiu Bo1-1/+4
When overcommitting, we should check the sum of pinned space and bytes for delayed item. Signed-off-by: Liu Bo <[email protected]>
2012-02-16Btrfs: kick out redundant stuff in convert_extent_bitLiu Bo1-5/+0
clear_state_bit will do merge_state for us, so kick out the redundant one. Signed-off-by: Liu Bo <[email protected]>
2012-02-16Btrfs: skip states when they does not contain bits to clearLiu Bo1-5/+10
Clearing a range's bits is different with setting them, since we don't need to touch them when states do not contain bits we want. Signed-off-by: Liu Bo <[email protected]>
2012-02-16Btrfs: check return value of lookup_extent_mapping() correctlyTsutomu Itoh3-2/+4
This patch corrects error checking of lookup_extent_mapping(). Signed-off-by: Tsutomu Itoh <[email protected]>
2012-02-16Btrfs: fix deadlock on page lock when doing auto-defragmentMiao Xie1-24/+29
When I ran xfstests circularly on a auto-defragment btrfs, the deadlock happened. Steps to reproduce: [tty0] # export MOUNT_OPTIONS="-o autodefrag" # export TEST_DEV=<partition1> # export TEST_DIR=<mountpoint1> # export SCRATCH_DEV=<partition2> # export SCRATCH_MNT=<mountpoint2> # while [ 1 ] > do > ./check 091 127 263 > sleep 1 > done [tty1] # while [ 1 ] > do > echo 3 > /proc/sys/vm/drop_caches > done Several hours later, the test processes will hang on, and the deadlock will happen on page lock. The reason is that: Auto defrag task Flush thread Test task btrfs_writepages() add ordered extent (including page 1, 2) set page 1 writeback set page 2 writeback endio_fn() end page 2 writeback release page 2 lock page 1 alloc and lock page 2 page 2 is not uptodate btrfs_readpage() start ordered extent() btrfs_writepages() try to lock page 1 so deadlock happens. Fix this bug by unlocking the page which is in writeback, and re-locking it after the writeback end. Signed-off-by: Miao Xie <[email protected]>
2012-02-16Btrfs: fix return value check of extent_io_opsTsutomu Itoh1-6/+10
This patch adds the check on the return value of extent_io_ops. Signed-off-by: Tsutomu Itoh <[email protected]>
2012-02-16ALSA: hda/realtek - Fix overflow of vol/sw check bitmapTakashi Iwai1-3/+8
The bitmap introduced in the commit [527e4d73: ALSA: hda/realtek - Fix missing volume controls with ALC260] is too narrow for some codecs, which may have more NIDs than 0x20, thus it may overflow the bitmap array on them. Just double the number to cover all and also add a sanity-check code to be safer. Cc: <[email protected]> [v3.2+] Signed-off-by: Takashi Iwai <[email protected]>
2012-02-16btrfs: honor umask when creating subvol rootFlorian Albrechtskirchinger1-2/+4
Set the subvol root inode permissions based on the current umask.
2012-02-16drm/exynos: added postclose to release resource.Inki Dae1-0/+12
Signed-off-by: Inki Dae <[email protected]> Signed-off-by: Kyungmin Park <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2012-02-16drm/exynos: removed exynos_drm_fbdev_recreate function.Inki Dae1-66/+4
this function ins't needed anymore. Signed-off-by: Inki Dae <[email protected]> Signed-off-by: Kyungmin Park <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2012-02-16drm/exynos: fixed page flip issue.Inki Dae3-5/+15
with vblank_refcount = 1, there was the case that drm_vblank_put is called by specific page flip function so this patch fixes the issue. Signed-off-by: Inki Dae <[email protected]> Signed-off-by: Kyungmin Park <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2012-02-16drm/exynos: added possible_clones setup function.Inki Dae4-0/+42
basically, all crtcs are possible to clone each other. Signed-off-by: Inki Dae <[email protected]> Signed-off-by: Kyungmin Park <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2012-02-16drm/exynos: removed pageflip_event_list init code when closed.Joonyoung Shim1-8/+2
if one process is terminated by ctrl-c while two processes are using pageflip feature then for last pageflip event, user can't get poll from kernel side so this patch fixes the problem. Signed-off-by: Joonyoung Shim <[email protected]> Signed-off-by: Inki Dae <[email protected]> Signed-off-by: Kyoungmin Park <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2012-02-16drm/exynos: changed priority of mixer layers.Joonyoung Shim1-5/+5
Signed-off-by: Joonyoung Shim <[email protected]> Signed-off-by: Inki Dae <[email protected]> Signed-off-by: Kyungmin Park <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2012-02-16drm/exynos: Fix typo in exynos_mixer.cMasanari Iida1-1/+1
Correct spelling "sucessful" to "successful" in drivers/gpu/drm/exynos/exynos_mixer.c Signed-off-by: Masanari Iida <[email protected]> Signed-off-by: Inki Dae <[email protected]> Signed-off-by: Kyungmin Park <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2012-02-16powerpc/perf: power_pmu_start restores incorrect values, breaking frequency ↵Anton Blanchard1-1/+7
events perf on POWER stopped working after commit e050e3f0a71b (perf: Fix broken interrupt rate throttling). That patch exposed a bug in the POWER perf_events code. Since the PMCs count upwards and take an exception when the top bit is set, we want to write 0x80000000 - left in power_pmu_start. We were instead programming in left which effectively disables the counter until we eventually hit 0x80000000. This could take seconds or longer. With the patch applied I get the expected number of samples: SAMPLE events: 9948 Signed-off-by: Anton Blanchard <[email protected]> Acked-by: Paul Mackerras <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]> Cc: <[email protected]>
2012-02-16powerpc/adb: Use set_current_state()majianpeng1-2/+2
Signed-off-by: majianpeng <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2012-02-16powerpc: Disable interrupts early in Program CheckBenjamin Herrenschmidt1-1/+1
Program Check exceptions are the result of WARNs, BUGs, some type of breakpoints, kprobe, and other illegal instructions. We want interrupts (and thus preemption) to remain disabled while doing the initial stage of testing the reason and branching off to a debugger or kprobe, so we are still on the original CPU which makes debugging easier in various cases. This is how the code was intended, hence the local_irq_enable() right in the middle of program_check_exception(). However, the assembly exception prologue for that exception was incorrectly marked as enabling interrupts, which defeats that (and records a redundant enable with lockdep). Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2012-02-16powerpc: Remove legacy iSeries from ppc64_defconfigStephen Rothwell1-5/+0
Since we are heading towards removing the Legacy iSeries platform, start by no longer building it for ppc64_defconfig. Signed-off-by: Stephen Rothwell <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2012-02-16powerpc/fsl/pci: Fix PCIe fixup regressionBenjamin Herrenschmidt1-19/+29
Upstream changes to the way PHB resources are registered broke the resource fixup for FSL boards. We can no longer rely on the resource pointer array for the PHB's pci_bus structure, so let's leave it alone and go straight for the PHB resources instead. This also makes the code generally more readable. Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2012-02-16powerpc: Fix kernel log of oops/panic instruction dumpIra Snyder1-3/+3
A kernel oops/panic prints an instruction dump showing several instructions before and after the instruction which caused the oops/panic. The code intended that the faulting instruction be enclosed in angle brackets, however a bug caused the faulting instruction to be interpreted by printk() as the message log level. To fix this, the KERN_CONT log level is added before the actual text of the printed message. === Before the patch === [ 1081.587266] Instruction dump: [ 1081.590236] 7c000110 7c0000f8 5400077c 552907f6 7d290378 992b0003 4e800020 38000001 [ 1081.598034] 3d20c03a 9009a114 7c0004ac 39200000 [ 1081.602500] 4e800020 3803ffd0 2b800009 <4>[ 1081.587266] Instruction dump: <4>[ 1081.590236] 7c000110 7c0000f8 5400077c 552907f6 7d290378 992b0003 4e800020 38000001 <4>[ 1081.598034] 3d20c03a 9009a114 7c0004ac 39200000 <98090000>[ 1081.602500] 4e800020 3803ffd0 2b800009 === After the patch === [ 51.385216] Instruction dump: [ 51.388186] 7c000110 7c0000f8 5400077c 552907f6 7d290378 992b0003 4e800020 38000001 [ 51.395986] 3d20c03a 9009a114 7c0004ac 39200000 <98090000> 4e800020 3803ffd0 2b800009 <4>[ 51.385216] Instruction dump: <4>[ 51.388186] 7c000110 7c0000f8 5400077c 552907f6 7d290378 992b0003 4e800020 38000001 <4>[ 51.395986] 3d20c03a 9009a114 7c0004ac 39200000 <98090000> 4e800020 3803ffd0 2b800009 Signed-off-by: Ira W. Snyder <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Cc: [email protected] Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2012-02-16crypto: sha512 - use standard ror64()Alexey Dobriyan2-9/+24
Use standard ror64() instead of hand-written. There is no standard ror64, so create it. The difference is shift value being "unsigned int" instead of uint64_t (for which there is no reason). gcc starts to emit native ROR instructions which it doesn't do for some reason currently. This should make the code faster. Patch survives in-tree crypto test and ping flood with hmac(sha512) on. Signed-off-by: Alexey Dobriyan <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2012-02-15drm/i915: do not enable RC6p on Sandy BridgeEugeni Dodonov1-2/+2
With base on latest findings, RC6p seems to be respondible for RC6-related issues on Sandy Bridge platform. To work-around those issues, the previous solution was to completely disable RC6 on Sandy Bridge for the past few releases, even if plain RC6 was not giving any issues. What this patch does is preventing RC6p from being enabled on Sandy Bridge even if users enable RC6 via a kernel parameter. So it won't change the defaults in any way, but will ensure that if users do enable RC6 manually it won't break their machines by enabling this extra state. Proper fix for this (enabling specific RC6 states according to the GPU generation) were proposed for the -next kernel, but we are too late in the release process now to pick such changes. Acked-by: Keith Packard <[email protected]> Signed-off-by: Eugeni Dodonov <[email protected]> Signed-off-by: Jesse Barnes <[email protected]>
2012-02-15ARM: 7327/1: need to include asm/system.h in asm/processor.hOlof Johansson1-0/+1
For files that include asm/processor.h but not asm/system.h: arch/arm/mach-msm/include/mach/uncompress.h: In function 'putc': arch/arm/mach-msm/include/mach/uncompress.h:48:3: error: implicit declaration of function 'smp_mb' [-Werror=implicit-function-declaration] In this case, smp_mb() is from the cpu_relax() call in the msm putc(). It likely went uncaught when the uncompress.h change went in since the defconfig didn't enable that code path, but later changes (e76f4750f4: ARM: debug: arrange Kconfig options more logically) resulted in the option being on for msm_defconfig and thus exposed it. Signed-off-by: Olof Johansson <[email protected]> Signed-off-by: Russell King <[email protected]>
2012-02-15ARM: 7326/2: PL330: fix null pointer dereference in pl330_chan_ctrl()Javi Merino1-1/+2
This fixes the thrd->req_running field being accessed before thrd is checked for null. The error was introduced in abb959f: ARM: 7237/1: PL330: Fix driver freeze Reference: <[email protected]> Cc: [email protected] Signed-off-by: Mans Rullgard <[email protected]> Acked-by: Javi Merino <[email protected]> Signed-off-by: Russell King <[email protected]>
2012-02-15ARM: 7164/3: PL330: Fix the size of the dst_cache_ctrl fieldJavi Merino1-1/+1
dst_cache_ctrl affects bits 3, 1 and 0 of AWCACHE but it is a 3-bit field in the Channel Control Register (see Table 3-21 of the DMA-330 Technical Reference Manual) and should be programmed as such. Reference: <[email protected]> Signed-off-by: Javi Merino <[email protected]> Acked-by: Jassi Brar <[email protected]> Signed-off-by: Russell King <[email protected]>
2012-02-15ARM: 7325/1: fix v7 boot with lockdep enabledRabin Vincent2-1/+6
Bootup with lockdep enabled has been broken on v7 since b46c0f74657d ("ARM: 7321/1: cache-v7: Disable preemption when reading CCSIDR"). This is because v7_setup (which is called very early during boot) calls v7_flush_dcache_all, and the save_and_disable_irqs added by that patch ends up attempting to call into lockdep C code (trace_hardirqs_off()) when we are in no position to execute it (no stack, MMU off). Fix this by using a notrace variant of save_and_disable_irqs. The code already uses the notrace variant of restore_irqs. Reviewed-by: Nicolas Pitre <[email protected]> Acked-by: Stephen Boyd <[email protected]> Cc: Catalin Marinas <[email protected]> Cc: [email protected] Signed-off-by: Rabin Vincent <[email protected]> Signed-off-by: Russell King <[email protected]>
2012-02-15net/ethernet: ks8851_mll fix irq handlingJan Weitzel1-8/+6
There a two different irq variables ks->irq and netdev->irq. Only ks->irq is set on probe, so disabling irq in ks_start_xmit fails. This patches remove ks->irq from private data and use only netdev->irq. Tested on a kernel 3.0 based OMAP4430 SMP Board Signed-off-by: Jan Weitzel <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2012-02-15veth: Enforce minimum size of VETH_INFO_PEERThomas Graf1-1/+3
VETH_INFO_PEER carries struct ifinfomsg plus optional IFLA attributes. A minimal size of sizeof(struct ifinfomsg) must be enforced or we may risk accessing that struct beyond the limits of the netlink message. Signed-off-by: Thomas Graf <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2012-02-15stmmac: update the driver version to Feb 2012 (v2)Giuseppe CAVALLARO1-1/+1
Signed-off-by: Giuseppe Cavallaro <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2012-02-15stmmac: move hw init in the probe (v2)Giuseppe CAVALLARO4-116/+105
This patch moves the MAC HW initialization and the HW feature verification from the open to the probe function as D. Miller suggested. So the patch actually reorganizes and tidies-up some parts of the driver and indeed fixes some problem when tune its HW features. These can be overwritten by looking at the HW cap register at run-time and that generated problems. Signed-off-by: Giuseppe Cavallaro <[email protected]> Reviewed-by: Francesco Virlinzi <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2012-02-15stmmac: request_irq when use an ext wake irq line (v2)Francesco Virlinzi1-0/+16
In case of we use an external Wake-Up IRQ line (priv->wol_irq != dev->irq) we need to invoke the request_irq. Signed-off-by: Francesco Virlinzi <[email protected]> Signed-off-by: Giuseppe Cavallaro <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2012-02-15stmmac: do not discard frame on dribbling bit assertGiuseppe CAVALLARO4-3/+9
If this bit is set and the CRC error is reset, then the packet is valid. Only report this as stat info. Signed-off-by: Giuseppe Cavallaro <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2012-02-15ipheth: Add iPhone 4STim Gardner1-0/+5
BugLink: http://bugs.launchpad.net/bugs/900802 Cc: [email protected] 3.2+ Signed-off-by: Till Kamppeter <[email protected]> Signed-off-by: Tim Gardner <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2012-02-15mlx4: add unicast steering entries to resource_trackerEugenia Emantayev1-7/+11
Add unicast steering entries to resource tracker. Do qp_detach also for these entries when VF doesn't shut down gracefully. Otherwise there is leakage of these resources, since they are not tracked. Signed-off-by: Eugenia Emantayev <[email protected]> Reviewed-by: Yevgeny Petrilin <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2012-02-15mlx4: fix QP tree trashingEugenia Emantayev1-0/+1
When adding new unicast steer entry, before moving qp to state ready, actually before calling mlx4_RST2INIT_QP_wrapper(), there were added a lot of entries with local_qpn=0 into radix tree. This fact impacted the get_res() function and proper functioning of resource tracker in addition to adding trash entries into radix tree. Signed-off-by: Eugenia Emantayev <[email protected]> Reviewed-by: Yevgeny Petrilin <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2012-02-15mlx4: fix buffer overrunEugenia Emantayev1-1/+1
When passing MLX4_UC_STEER=1 it was translated to value 2 after mlx4_QP_ATTACH_wrapper. Therefore in new_steering_entry() unicast steer entries were added to index 2 of array of size 2. Fixing this bug by shift right to one position. Signed-off-by: Eugenia Emantayev <[email protected]> Reviewed-by: Yevgeny Petrilin <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2012-02-15ath9k: stop on rates with idx -1 in ath9k rate control's .tx_statusPavel Roskin1-1/+1
Rate control algorithms are supposed to stop processing when they encounter a rate with the index -1. Checking for rate->count not being zero is not enough. Allowing a rate with negative index leads to memory corruption in ath_debug_stat_rc(). One consequence of the bug is discussed at https://bugzilla.redhat.com/show_bug.cgi?id=768639 Signed-off-by: Pavel Roskin <[email protected]> Cc: [email protected] Signed-off-by: John W. Linville <[email protected]>
2012-02-15mwifiex: clear previous security setting during associationAmitkumar Karwar1-1/+7
Driver maintains different flags for WEP, WPA, WPA2 security modes. Appropriate flag is set using security information provided in connect request. mwifiex_is_network_compatible() routine uses them to check if driver's setting is compatible with AP. Association is aborted if the routine fails. For some corner cases, it is observed that association is failed even for valid security information based on association history. This patch fixes the problem by clearing previous security setting during each association. We should set WEP key provided in connect request as default tx key. This missing change is also added here. Signed-off-by: Amitkumar Karwar <[email protected]> Signed-off-by: Bing Zhao <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2012-02-15mac80211: do not call rate control .tx_status before .rate_initFelix Fietkau1-1/+1
Most rate control implementations assume .get_rate and .tx_status are only called once the per-station data has been fully initialized. minstrel_ht crashes if this assumption is violated. Signed-off-by: Felix Fietkau <[email protected]> Tested-by: Arend van Spriel <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2012-02-15mac80211: call rate control only after initJohannes Berg4-3/+6
There are situations where we don't have the necessary rate control information yet for station entries, e.g. when associating. This currently doesn't really happen due to the dummy station handling; explicitly disabling rate control when it's not initialised will allow us to remove dummy stations. Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2012-02-15Merge branch 'master' of ↵John W. Linville2-4/+4
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless into for-davem
2012-02-15regmap: Fix cache defaults initialization from raw cache defaultsLars-Peter Clausen1-2/+2
Currently registers with a value of 0 are ignored when initializing the register defaults from raw defaults. This worked in the past, because registers without a explicit default were assumed to have a default value of 0. This was changed in commit b03622a8 ("regmap: Ensure rbtree syncs registers set to zero properly"). As a result registers, which have a raw default value of 0 are now assumed to have no default. This again can result in unnecessary writes when syncing the cache. It will also result in unnecessary reads for e.g. the first update operation. In the case where readback is not possible this will even let the update operation fail, if the register has not been written to before. So this patch removes the check. Instead it adds a check to ignore raw defaults for registers which are volatile, since those registers are not cached. Signed-off-by: Lars-Peter Clausen <[email protected]> Signed-off-by: Mark Brown <[email protected]> Cc: [email protected]
2012-02-15i387: fix sense of sanity checkLinus Torvalds1-1/+1
The check for save_init_fpu() (introduced in commit 5b1cbac37798: "i387: make irq_fpu_usable() tests more robust") was the wrong way around, but I hadn't noticed, because my "tests" were bogus: the FPU exceptions are disabled by default, so even doing a divide by zero never actually triggers this code at all unless you do extra work to enable them. So if anybody did enable them, they'd get one spurious warning. Signed-off-by: Linus Torvalds <[email protected]>
2012-02-15btrfs: silence warning in raid array setupDavid Sterba1-0/+14
Raid array setup code creates an extent buffer in an usual way. When the PAGE_CACHE_SIZE is > super block size, the extent pages are not marked up-to-date, which triggers a WARN_ON in the following write_extent_buffer call. Add an explicit up-to-date call to silence the warning. Signed-off-by: David Sterba <[email protected]>
2012-02-15btrfs: fix structs where bitfields and spinlock/atomic share 8B wordDavid Sterba2-3/+3
On ia64, powerpc64 and sparc64 the bitfield is modified through a RMW cycle and current gcc rewrites the adjacent 4B word, which in case of a spinlock or atomic has disaterous effect. https://lkml.org/lkml/2012/2/1/220 Signed-off-by: David Sterba <[email protected]>
2012-02-15btrfs: delalloc for page dirtied out-of-band in fixup workerJeff Mahoney3-27/+53
We encountered an issue that was easily observable on s/390 systems but could really happen anywhere. The timing just seemed to hit reliably on s/390 with limited memory. The gist is that when an unexpected set_page_dirty() happened, we'd run into the BUG() in btrfs_writepage_fixup_worker since it wasn't properly set up for delalloc. This patch does the following: - Performs the missing delalloc in the fixup worker - Allow the start hook to return -EBUSY which informs __extent_writepage that it should mark the page skipped and not to redirty it. This is required since the fixup worker can fail with -ENOSPC and the page will have already been redirtied. That causes an Oops in drop_outstanding_extents later. Retrying the fixup worker could lead to an infinite loop. Deferring the page redirty also saves us some cycles since the page would be stuck in a resubmit-redirty loop until the fixup worker completes. It's not harmful, just wasteful. - If the fixup worker fails, we mark the page and mapping as errored, and end the writeback, similar to what we would do had the page actually been submitted to writeback. Signed-off-by: Jeff Mahoney <[email protected]>
2012-02-15Btrfs: fix memory leak in load_free_space_cache()Tsutomu Itoh1-0/+1
load_free_space_cache() has forgotten to free path. Signed-off-by: Tsutomu Itoh <[email protected]>