aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2011-01-31Input: input-polldev - fix a couple of typosDmitry Torokhov2-4/+4
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-01-31Input: switch completely over to the new versions of get/setkeycodeDmitry Torokhov7-67/+20
All users of old style get/setkeycode methids have been converted so it is time to retire them. Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com> Acked-by: Jiri Kosina <jkosina@suse.cz> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-01-31Input: dvb-usb-remote - convert to new style of get/setkeycodeDmitry Torokhov1-43/+70
Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-01-31Merge commit 'v2.6.38-rc3' into nextDmitry Torokhov9226-276811/+578681
2011-01-31Input: wm831x-ts - remove use of ternary operatorMark Brown1-5/+13
While being applied the driver was modified to add use of the ternary operator. Write the conditionals out longhand as I find it terribly unhelpful for legibility. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-02-01Linux 2.6.38-rc3Linus Torvalds1-1/+1
2011-02-01Merge branch 'bugfixes' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6Linus Torvalds25-210/+174
* 'bugfixes' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6: NFS: NFSv4 readdir loses entries NFS: Micro-optimize nfs4_decode_dirent() NFS: Fix an NFS client lockdep issue NFS construct consistent co_ownerid for v4.1 NFS: nfs_wcc_update_inode() should set nfsi->attr_gencount NFS improve pnfs_put_deviceid_cache debug print NFS fix cb_sequence error processing NFS do not find client in NFSv4 pg_authenticate NLM: Fix "kernel BUG at fs/lockd/host.c:417!" or ".../host.c:283!" NFS: Prevent memory allocation failure in nfsacl_encode() NFS: nfsacl_{encode,decode} should return signed integer NFS: Fix "kernel BUG at fs/nfs/nfs3xdr.c:1338!" NFS: Fix "kernel BUG at fs/aio.c:554!" NFS4: Avoid potential NULL pointer dereference in decode_and_add_ds(). NFS: fix handling of malloc failure during nfs_flush_multi()
2011-02-01Merge branch 'fixes' of master.kernel.org:/home/rmk/linux-2.6-armLinus Torvalds5-35/+41
* 'fixes' of master.kernel.org:/home/rmk/linux-2.6-arm: ARM: smp_on_up: allow non-ARM SMP processors ARM: io: ensure inb/outb() et.al. are properly ordered on ARMv6+ ARM: initrd: disable initrd if passed address overlaps reserved region ARM: footbridge: fix debug macros ARM: mmci: round down the bytes transferred on error ARM: mmci: complete the transaction on error ARM: 6642/1: mmci: calculate remaining bytes at error correctly
2011-02-01Merge branch 'omap-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6Linus Torvalds6-34/+5
* 'omap-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6: arch/arm/mach-omap2/dma.c: Convert IS_ERR result to PTR_ERR arm: omap2: mux: fix compile warning omap1: Simplify use of omap_irq_flags omap2+: Fix unused variable warning for omap_irq_base
2011-02-01kernel.h: fix kernel-doc warningRandy Dunlap1-1/+1
Fix kernel-doc warning in kernel.h from commit 7ef88ad56145 ("BUILD_BUG_ON: make it handle more cases"): Warning(include/linux/kernel.h:605): No description found for parameter 'condition' Warning(include/linux/kernel.h:605): Excess function parameter 'cond' description in 'BUILD_BUG_ON' Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-02-01Merge branch 'for-linus' of git://oss.sgi.com/xfs/xfsLinus Torvalds10-71/+152
* 'for-linus' of git://oss.sgi.com/xfs/xfs: xfs: xfs_bmap_add_extent_delay_real should init br_startblock xfs: fix dquot shaker deadlock xfs: handle CIl transaction commit failures correctly xfs: limit extsize to size of AGs and/or MAXEXTLEN xfs: prevent extsize alignment from exceeding maximum extent size xfs: limit extent length for allocation to AG size xfs: speculative delayed allocation uses rounddown_power_of_2 badly xfs: fix efi item leak on forced shutdown xfs: fix log ticket leak on forced shutdown.
2011-02-01virtio: update MAINTAINERSMichael S. Tsirkin1-0/+10
Patches should keep coming through Rusty but it helps if I'm Cc'd as well. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-02-01Merge branch 'usb-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6Linus Torvalds48-381/+568
* 'usb-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6: (42 commits) usb: gadget: composite: avoid access beyond array max length USB: serial: handle Data Carrier Detect changes USB: gadget: Fix endpoint representation in ci13xxx_udc USB: gadget: Fix error path in ci13xxx_udc gadget probe function usb: pch_udc: Fix the worning log issue at gadget driver remove USB: serial: Updated support for ICOM devices USB: ehci-mxc: add work-around for efika mx/sb bug USB: unbreak ehci-mxc on otg port of i.MX27 drivers: update to pl2303 usb-serial to support Motorola cables USB: adding USB support for Cinterion's HC2x, EU3 and PH8 products USB serial: add missing .usb_driver field in serial drivers USB: ehci-fsl: Fix 'have_sysif_regs' detection USB: g_printer: fix bug in module parameter definitions USB: g_printer: fix bug in unregistration USB: uss720: remove duplicate USB device MAINTAINERS: add ueagle-atm entry USB: EHCI: fix DMA deallocation bug USB: pch_udc: support new device ML7213 IOH usb: pch_udc: Fixed issue which does not work with g_serial usb: set ep_dev async suspend should be later than device_initialize ...
2011-02-01Merge branch 'staging-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6Linus Torvalds27-134/+294
* 'staging-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6: (26 commits) staging: r8712u: Add new device IDs staging: brcm80211: fix suspend/resume issue in brcmsmac staging: brcm80211: remove assert to avoid panic since 2.6.37 kernel Staging: iio: Aditional fixpoint formatted output bugfix staging: usbip: vhci: use urb->dev->portnum to find port staging: usbip: vhci: handle EAGAIN from SO_RCVTIMEO staging: usbip: vhci: friendly log messages for connection errors staging: usbip: vhci: refuse to enqueue for dead connections staging: usbip: vhci: give back URBs from in-flight unlink requests staging: usbip: vhci: update reference count for usb_device staging: usbip: stub: update refcounts for devices and interfaces staging: tidspbridge: replace mbox callback with notifier_call staging: comedi: ni_labpc: Use shared IRQ for PCMCIA card Staging: speakup: &&/|| confusion in silent_store() iio: Fixpoint formatted output bugfix staging: rt2860: Fix incorrect netif_stop_queue usage warning staging: r8712u: Fix memory leak in firmware loading staging: tidspbridge: configure full L1 MMU range staging: rt2870sta: Add ID for Linksys WUSB100v2 Staging: xgfib: put parenthesis in the right place ...
2011-02-01Merge branch 'tty-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6Linus Torvalds5-51/+58
* 'tty-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6: tty/serial: fix apbuart build n_hdlc: fix read and write locking serial: unbreak billionton CF card tty: use for_each_console() and WARN() on sysfs failures vt: fix issue when fbcon wants to takeover a second time. Fix up trivial conflict in drivers/tty/tty_io.c
2011-01-31ARM: smp_on_up: allow non-ARM SMP processorsRussell King1-12/+10
Allow non-ARM SMP processors to use the SMP_ON_UP feature. CPUs supporting SMP must have the new CPU ID format, so check for this first. Then check for ARM11MPCore, which fails the MPIDR check. Lastly check the MPIDR reports multiprocessing extensions and that the CPU is part of a multiprocessing system. Cc: <stable@kernel.org> Reported-and-Tested-by: Stephen Boyd <sboyd@codeaurora.org> Acked-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2011-01-31ARM: io: ensure inb/outb() et.al. are properly ordered on ARMv6+Russell King1-16/+17
Ensure that the ISA/PCI IO space accessors are properly ordered on ARMv6+ architectures. These should always be ordered with respect to all other accesses. This also fixes __iormb() and __iowmb() not being visible to ioread/ iowrite if a platform defines its own MMIO accessors. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2011-01-31ARM: initrd: disable initrd if passed address overlaps reserved regionRussell King1-0/+6
Disable the initrd if the passed address already overlaps the reserved region. This avoids oopses on Netwinders when NeTTrom tells the kernel that an initrd is located at mem+4MB, but this overlaps the BSS, resulting in the kernels in-use BSS being freed. This should be applied to v2.6.37-stable. Cc: <stable@kernel.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2011-01-31ARM: footbridge: fix debug macrosRussell King1-2/+2
0ea1293 (arm: return both physical and virtual addresses from addruart) changed the way the 'addruart' worked, making it return both the virt and phys addresses. Unfortunately, for footbridge, these were reversed. Fix that. Tested on Netwinder. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2011-01-31ARM: mmci: round down the bytes transferred on errorRussell King1-3/+4
We should not report incomplete blocks on error. Return the number of bytes successfully transferred, rounded down to the nearest block. Acked-by: Linus Walleij <linus.walleij@stericsson.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2011-01-31ARM: mmci: complete the transaction on errorRussell King1-1/+1
When we encounter an error, make sure we complete the transaction otherwise we'll leave the request dangling. Acked-by: Linus Walleij <linus.walleij@stericsson.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2011-01-31Merge branch 'for-linus' of git://git.infradead.org/ubi-2.6Linus Torvalds1-27/+1
* 'for-linus' of git://git.infradead.org/ubi-2.6: Revert "UBI: use mtd->writebufsize to set minimal I/O unit size"
2011-01-31Input: rc-keymap - return KEY_RESERVED for unknown mappingsDmitry Torokhov1-11/+17
Do not respond with -EINVAL to EVIOCGKEYCODE for not-yet-mapped scancodes, but rather return KEY_RESERVED. This fixes breakage with Ubuntu's input-kbd utility that stopped returning full keymaps for remote controls. Tested-by: Mauro Carvalho Chehab <mchehab@redhat.com> Tested-by: Mark Lord <kernel@teksavvy.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-01-31Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/inputLinus Torvalds2-11/+27
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: synaptics - retry failed resets when reconnecting Input: synaptics - fix reconnect logic on MT devices Input: tegra-kbc - fix keymap entry for LeftMeta key Input: tegra-kbc - fix build error
2011-01-31Fix prlimit64 for suid/sgid processesKacper Kornet1-1/+2
Since check_prlimit_permission always fails in the case of SUID/GUID processes, such processes are not able to read or set their own limits. This commit changes this by assuming that process can always read/change its own limits. Signed-off-by: Kacper Kornet <kornet@camk.edu.pl> Acked-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-01-31intel_scu_ipc: remove duplicated #includeHuang Weiyi1-1/+0
Remove duplicated #include('s) in drivers/platform/x86/intel_scu_ipc.c Signed-off-by: Huang Weiyi <weiyi.huang@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-01-31NTFS: Fix invalid pointer dereference in ntfs_mft_record_alloc().Anton Altaparmakov2-4/+9
In ntfs_mft_record_alloc() when mapping the new extent mft record with map_extent_mft_record() we overwrite @m with the return value and on error, we then try to use the old @m but that is no longer there as @m now contains an error code instead so we crash when dereferencing the error code as if it were a pointer. The simple fix is to use a temporary variable to store the return value thus preserving the original @m for later use. This is a backport from the commercial Tuxera-NTFS driver and is well tested... Thanks go to Julia Lawall for pointing this out (whilst I had fixed it in the commercial driver I had failed to fix it in the Linux kernel). Signed-off-by: Anton Altaparmakov <anton@tuxera.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-01-31Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6Linus Torvalds15-704/+371
* git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6: cifs: More crypto cleanup (try #2) CIFS: Add strictcache mount option CIFS: Implement cifs_strict_writev (try #4) [CIFS] Replace cifs md5 hashing functions with kernel crypto APIs
2011-01-31Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cmarinas/linux-2.6-cmLinus Torvalds2-9/+10
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cmarinas/linux-2.6-cm: kmemleak: Allow kmemleak metadata allocations to fail kmemleak: remove memset by using kzalloc
2011-01-31Merge branch 'zerolen' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/misc-2.6Linus Torvalds1-0/+0
* 'zerolen' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/misc-2.6: Delete zero-length drivers/staging/vme/bridges/Module.symvers
2011-01-31Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6Linus Torvalds19-56/+54
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6: ALSA: HDA: Fix automute on Thinkpad L412/L512 ALSA: HDA: Fix dmesg output of HDMI supported bits ALSA: fix invalid hardware.h include in ac97c for AVR32 architecture ASoC: correct link specifications for corgi, poodle and spitz ASoC: Samsung: Fix outdated cpu_dai_name for s3c24xx i2s ASoC: Fix codec device id format used by some dai_links ALSA: azt3328 - fix broken AZF_FMT_XLATE macro ALSA: Xonar, CS43xx: Don't overrun static array ASoC: Handle low measured DC offsets for wm_hubs devices ASoC: da8xx/omap-l1xx: match codec_name with i2c ids ASoC: WM8994: fix wrong value in tristate function ASoC: WM8995: Fix incorrect use of snd_soc_update_bits()
2011-01-31Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-devLinus Torvalds7-75/+85
* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev: libata: set queue DMA alignment to sector size for ATAPI too libata: DVR-212D can't do SETXFER DVD-RW DVR-212D ahci: add HFLAG_YES_FBS and apply it to 88SE9128 pata_hpt37x: inherit prereset() method for HPT374 ahci: AHCI mode SATA patch for Intel DH89xxCC DeviceIDs pata_hpt37x: fold 'if' statement into 'switch' pata_hpt{37x|3x2n}: use pr_*(DRV_NAME ...) instead of printk(KERN_* ...) pata_hpt{366|37x}: use pr_warning(...) instead of printk(KERN_WARNING ...) pata_mpc52xx: inherit from ata_bmdma_port_ops
2011-01-31Merge branch 'for-linus' of git://android.git.kernel.org/kernel/tegraLinus Torvalds4-11/+15
* 'for-linus' of git://android.git.kernel.org/kernel/tegra: ARM: tegra: clock: Add forward reference to struct clk ARM: tegra: irq: Rename gic pointers to avoid conflicts arm/tegra: Fix tegra irq_data conversion
2011-01-30Input: wm831x - add driver for Wolfson WM831x PMIC touchscreen controllersMark Brown4-1/+368
Some of the WM831x series of PMICs from Wolfson Microelectronics include a resistive touchscreen controller. Implement support for these controllers within the input API. Platform data is supported to allow configuration of system parameters such as selection between four and five wire touchscreens and for specification of optional direct to CPU IRQs for sample availability and for pen down. Use of this feature for at least the data IRQ is strongly recommended. Thanks to Julien Boibessot for extensive testing and detailed feedback. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Tested-by: Julien Boibessot <julien.boibessot@armadeus.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-01-29Revert "UBI: use mtd->writebufsize to set minimal I/O unit size"Artem Bityutskiy1-27/+1
This reverts commit a121f643993474548fe98144514c50dd4f3dbe76. Unfortunately, this commit breaks UBIFS backward compatibility and makes new UBIFS refuse older UBIFS-formatted media: UBIFS error: validate_sb: min. I/O unit mismatch: 8 in superblock, 64 real Thus, we have to revert this patch and work on a better solution. Reported-by: Holger Brunck <holger.brunck@keymile.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2011-01-28Input: synaptics - retry failed resets when reconnectingAlexandre Peixoto Ferreira1-2/+11
On some machines, like Dell Studio XPS 16 (1640), touchpad fails to respond to the standard query after first reset but may start responding later, so let's repeat reset sequence several (3) times. Signed-off-by: Alexandre Peixoto Ferreira <alexandref75@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-01-28Input: synaptics - fix reconnect logic on MT devicesAlexandre Peixoto Ferreira1-6/+13
synaptics_set_advanced_gesture_mode() affect capabilities bits we should perform comparison after calling this function, otherwise they will never match and we will be forced to perform full reconnect. Signed-off-by: Alexandre Peixoto Ferreira <alexandref75@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-01-28Input: tegra-kbc - fix keymap entry for LeftMeta keyRakesh Iyer1-1/+1
Correct key mapping for Left Meta key. Signed-off-by: Rakesh Iyer <riyer@nvidia.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-01-28Input: tegra-kbc - fix build errorRakesh Iyer1-2/+2
Fix build error introduced by variable name change. Signed-off-by: Rakesh Iyer <riyer@nvidia.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-01-28NFS: NFSv4 readdir loses entriesChuck Lever1-3/+0
On recent 2.6.38-rc kernels, connectathon basic test 6 fails on NFSv4 mounts of OpenSolaris with something like: > ./test6: readdir > ./test6: (/mnt/klimt/matisse.test) didn't read expected 'file.12' dir entry, pass 0 > ./test6: (/mnt/klimt/matisse.test) didn't read expected 'file.82' dir entry, pass 0 > ./test6: (/mnt/klimt/matisse.test) didn't read expected 'file.164' dir entry, pass 0 > ./test6: (/mnt/klimt/matisse.test) Test failed with 3 errors > basic tests failed > Tests failed, leaving /mnt/klimt mounted > [cel@matisse cthon04]$ I narrowed the problem down to nfs4_decode_dirent() reporting that the decode buffer had overflowed while decoding the entries for those missing files. verify_attr_len() assumes both it's pointer arguments reside on the same page. When these arguments point to locations on two different pages, verify_attr_len() can report false errors. This can happen now that a large NFSv4 readdir result can span pages. We have reasonably good checking in nfs4_decode_dirent() anyway, so it should be safe to simply remove the extra checking. At a guess, this was introduced by commit 6650239a, "NFS: Don't use vm_map_ram() in readdir". Cc: stable@kernel.org [2.6.37] Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2011-01-28NFS: Micro-optimize nfs4_decode_dirent()Chuck Lever1-3/+3
Make the decoding of NFSv4 directory entries slightly more efficient by: 1. Avoiding unnecessary byte swapping when checking XDR booleans, and 2. Not bumping "p" when its value will be immediately replaced by xdr_inline_decode() This commit makes nfs4_decode_dirent() consistent with similar logic in the other two decode_dirent() functions. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2011-01-28NFS: Fix an NFS client lockdep issueTrond Myklebust1-2/+4
There is no reason to be freeing the delegation cred in the rcu callback, and doing so is resulting in a lockdep complaint that rpc_credcache_lock is being called from both softirq and non-softirq contexts. Reported-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Cc: stable@kernel.org
2011-01-28xfs: xfs_bmap_add_extent_delay_real should init br_startblockbpm@sgi.com1-8/+25
When filling in the middle of a previous delayed allocation in xfs_bmap_add_extent_delay_real, set br_startblock of the new delay extent to the right to nullstartblock instead of 0 before inserting the extent into the ifork (xfs_iext_insert), rather than setting br_startblock afterward. Adding the extent into the ifork with br_startblock=0 can lead to the extent being copied into the btree by xfs_bmap_extent_to_btree if we happen to convert from extents format to btree format before updating br_startblock with the correct value. The unexpected addition of this delay extent to the btree can cause subsequent XFS_WANT_CORRUPTED_GOTO filesystem shutdown in several xfs_bmap_add_extent_delay_real cases where we are converting a delay extent to real and unexpectedly find an extent already inserted. For example: 911 case BMAP_LEFT_FILLING: 912 /* 913 * Filling in the first part of a previous delayed allocation. 914 * The left neighbor is not contiguous. 915 */ 916 trace_xfs_bmap_pre_update(ip, idx, state, _THIS_IP_); 917 xfs_bmbt_set_startoff(ep, new_endoff); 918 temp = PREV.br_blockcount - new->br_blockcount; 919 xfs_bmbt_set_blockcount(ep, temp); 920 xfs_iext_insert(ip, idx, 1, new, state); 921 ip->i_df.if_lastex = idx; 922 ip->i_d.di_nextents++; 923 if (cur == NULL) 924 rval = XFS_ILOG_CORE | XFS_ILOG_DEXT; 925 else { 926 rval = XFS_ILOG_CORE; 927 if ((error = xfs_bmbt_lookup_eq(cur, new->br_startoff, 928 new->br_startblock, new->br_blockcount, 929 &i))) 930 goto done; 931 XFS_WANT_CORRUPTED_GOTO(i == 0, done); With the bogus extent in the btree we shutdown the filesystem at 931. The conversion from extents to btree format happens when the number of extents in the inode increases above ip->i_df.if_ext_max. xfs_bmap_extent_to_btree copies extents from the ifork into the btree, ignoring all delalloc extents which are denoted by br_startblock having some value of nullstartblock. SGI-PV: 1013221 Signed-off-by: Ben Myers <bpm@sgi.com> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Alex Elder <aelder@sgi.com>
2011-01-28xfs: fix dquot shaker deadlockDave Chinner1-25/+21
Commit 368e136 ("xfs: remove duplicate code from dquot reclaim") fails to unlock the dquot freelist when the number of loop restarts is exceeded in xfs_qm_dqreclaim_one(). This causes hangs in memory reclaim. Rework the loop control logic into an unwind stack that all the different cases jump into. This means there is only one set of code that processes the loop exit criteria, and simplifies the unlocking of all the items from different points in the loop. It also fixes a double increment of the restart counter from the qi_dqlist_lock case. Reported-by: Malcolm Scott <lkml@malc.org.uk> Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Alex Elder <aelder@sgi.com>
2011-01-28xfs: handle CIl transaction commit failures correctlyDave Chinner3-12/+3
Failure to commit a transaction into the CIL is not handled correctly. This currently can only happen when racing with a shutdown and requires an explicit shutdown check, so it rare and can be avoided. Remove the shutdown check and make the CIL commit a void function to indicate it will always succeed, thereby removing the incorrectly handled failure case. Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Alex Elder <aelder@sgi.com>
2011-01-28xfs: limit extsize to size of AGs and/or MAXEXTLENDave Chinner1-2/+18
The extent size hint can be set to larger than an AG. This means that the alignment process can push the range to be allocated outside the bounds of the AG, resulting in assert failures or corrupted bmbt records. Similarly, if the extsize is larger than the maximum extent size supported, the alignment process will produce extents that are too large to fit into the bmbt records, resulting in a different type of assert/corruption failure. Fix this by limiting extsize at the time іt is set firstly to be less than MAXEXTLEN, then to be a maximum of half the size of the AGs in the filesystem for non-realtime inodes. Realtime inodes do not allocate out of AGs, so don't have to be restricted by the size of AGs. Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Alex Elder <aelder@sgi.com>
2011-01-28xfs: prevent extsize alignment from exceeding maximum extent sizeDave Chinner1-0/+10
When doing delayed allocation, if the allocation size is for a maximally sized extent, extent size alignment can push it over this limit. This results in an assert failure in xfs_bmbt_set_allf() as the extent length is too large to find in the extent record. Fix this by ensuring that we allow for space that extent size alignment requires (up to 2 * (extsize -1) blocks as we have to handle both head and tail alignment) when limiting the maximum size of the extent. Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Alex Elder <aelder@sgi.com>
2011-01-28xfs: limit extent length for allocation to AG sizeDave Chinner2-8/+26
Delayed allocation extents can be larger than AGs, so when trying to convert a large range we may scan every AG inside xfs_bmap_alloc_nullfb() trying to find an AG with a size larger than an AG. We should stop when we find the first AG with a maximum possible allocation size. This causes excessive CPU usage when there are lots of AGs. The same problem occurs when doing preallocation of a range larger than an AG. Fix the problem by limiting real allocation lengths to the maximum that an AG can support. This means if we have empty AGs, we'll stop the search at the first of them. If there are no empty AGs, we'll still scan them all, but that is a different problem.... Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Alex Elder <aelder@sgi.com>
2011-01-28xfs: speculative delayed allocation uses rounddown_power_of_2 badlyDave Chinner1-1/+6
rounddown_power_of_2() returns an undefined result when passed a value of zero. The specualtive delayed allocation code is doing this when the inode is zero length. Hence occasionally the preallocation is much, much larger than is necessary (e.g. 8GB for a 270 _byte_ file). Ensure we don't even pass a zero value to this function so the result of preallocation is always the desired size. Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Alex Elder <aelder@sgi.com>
2011-01-28xfs: fix efi item leak on forced shutdownDave Chinner3-13/+38
After test 139, kmemleak shows: unreferenced object 0xffff880078b405d8 (size 400): comm "xfs_io", pid 4904, jiffies 4294909383 (age 1186.728s) hex dump (first 32 bytes): 60 c1 17 79 00 88 ff ff 60 c1 17 79 00 88 ff ff `..y....`..y.... 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [<ffffffff81afb04d>] kmemleak_alloc+0x2d/0x60 [<ffffffff8115c6cf>] kmem_cache_alloc+0x13f/0x2b0 [<ffffffff814aaa97>] kmem_zone_alloc+0x77/0xf0 [<ffffffff814aab2e>] kmem_zone_zalloc+0x1e/0x50 [<ffffffff8147cd6b>] xfs_efi_init+0x4b/0xb0 [<ffffffff814a4ee8>] xfs_trans_get_efi+0x58/0x90 [<ffffffff81455fab>] xfs_bmap_finish+0x8b/0x1d0 [<ffffffff814851b4>] xfs_itruncate_finish+0x2c4/0x5d0 [<ffffffff814a970f>] xfs_setattr+0x8df/0xa70 [<ffffffff814b5c7b>] xfs_vn_setattr+0x1b/0x20 [<ffffffff8117dc00>] notify_change+0x170/0x2e0 [<ffffffff81163bf6>] do_truncate+0x66/0xa0 [<ffffffff81163d0b>] sys_ftruncate+0xdb/0xe0 [<ffffffff8103a002>] system_call_fastpath+0x16/0x1b [<ffffffffffffffff>] 0xffffffffffffffff The cause of the leak is that the "remove" parameter of IOP_UNPIN() is never set when a CIL push is aborted. This means that the EFI item is never freed if it was in the push being cancelled. The problem is specific to delayed logging, but has uncovered a couple of problems with the handling of IOP_UNPIN(remove). Firstly, we cannot safely call xfs_trans_del_item() from IOP_UNPIN() in the CIL commit failure path or the iclog write failure path because for delayed loging we have no transaction context. Hence we must only call xfs_trans_del_item() if the log item being unpinned has an active log item descriptor. Secondly, xfs_trans_uncommit() does not handle log item descriptor freeing during the traversal of log items on a transaction. It can reference a freed log item descriptor when unpinning an EFI item. Hence it needs to use a safe list traversal method to allow items to be removed from the transaction during IOP_UNPIN(). Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Alex Elder <aelder@sgi.com>