1
0
Fork 0
Commit Graph

174441 Commits (661f627da98c0647bcc002ef35e5441fb3ce667c)

Author SHA1 Message Date
Stephen Rothwell accee7854b block: include linux/err.h to use ERR_PTR
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-12-07 09:47:07 +01:00
Akira Fujita 4a58579b9e ext4: Fix insufficient checks in EXT4_IOC_MOVE_EXT
This patch fixes three problems in the handling of the
EXT4_IOC_MOVE_EXT ioctl:

1. In current EXT4_IOC_MOVE_EXT, there are read access mode checks for
original and donor files, but they allow the illegal write access to
donor file, since donor file is overwritten by original file data.  To
fix this problem, change access mode checks of original (r->r/w) and
donor (r->w) files.

2.  Disallow the use of donor files that have a setuid or setgid bits.

3.  Call mnt_want_write() and mnt_drop_write() before and after
ext4_move_extents() calling to get write access to a mount.

Signed-off-by: Akira Fujita <a-fujita@rs.jp.nec.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-12-06 23:38:31 -05:00
Jan Kara b436b9bef8 ext4: Wait for proper transaction commit on fsync
We cannot rely on buffer dirty bits during fsync because pdflush can come
before fsync is called and clear dirty bits without forcing a transaction
commit. What we do is that we track which transaction has last changed
the inode and which transaction last changed allocation and force it to
disk on fsync.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-12-08 23:51:10 -05:00
Dmitry Monakhov 194074acac ext4: fix incorrect block reservation on quota transfer.
Inside ->setattr() call both ATTR_UID and ATTR_GID may be valid
This means that we may end-up with transferring all quotas. Add
we have to reserve QUOTA_DEL_BLOCKS for all quotas, as we do in
case of QUOTA_INIT_BLOCKS.

Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Reviewed-by: Mingming Cao <cmm@us.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-12-08 22:42:28 -05:00
Dmitry Monakhov 5aca07eb7d ext4: quota macros cleanup
Currently all quota block reservation macros contains hard-coded "2"
aka MAXQUOTAS value. This is no good because in some places it is not
obvious to understand what does this digit represent. Let's introduce
new macro with self descriptive name.

Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Acked-by: Mingming Cao <cmm@us.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-12-08 22:42:15 -05:00
Dmitry Monakhov 8aa6790f87 ext4: ext4_get_reserved_space() must return bytes instead of blocks
Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Acked-by: Mingming Cao <cmm@us.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-12-08 22:41:52 -05:00
Curt Wohlgemuth b844167edc ext4: remove blocks from inode prealloc list on failure
This fixes a leak of blocks in an inode prealloc list if device failures
cause ext4_mb_mark_diskspace_used() to fail.

Signed-off-by: Curt Wohlgemuth <curtw@google.com>
Acked-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-12-08 22:18:25 -05:00
Josef Bacik d4edac314e ext4: wait for log to commit when umounting
There is a potential race when a transaction is committing right when
the file system is being umounting.  This could reduce in a race
because EXT4_SB(sb)->s_group_info could be freed in ext4_put_super
before the commit code calls a callback so the mballoc code can
release freed blocks in the transaction, resulting in a panic trying
to access the freed s_group_info.

The fix is to wait for the transaction to finish committing before we
shutdown the multiblock allocator.  

Signed-off-by: Josef Bacik <josef@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-12-08 21:48:58 -05:00
Jan Kara b9a4207d5e ext4: Avoid data / filesystem corruption when write fails to copy data
When ext4_write_begin fails after allocating some blocks or
generic_perform_write fails to copy data to write, we truncate blocks
already instantiated beyond i_size.  Although these blocks were never
inside i_size, we have to truncate the pagecache of these blocks so
that corresponding buffers get unmapped.  Otherwise subsequent
__block_prepare_write (called because we are retrying the write) will
find the buffers mapped, not call ->get_block, and thus the page will
be backed by already freed blocks leading to filesystem and data
corruption.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-12-08 21:24:33 -05:00
Theodore Ts'o 24b584240a ext4: Use ext4 file system driver for ext2/ext3 file system mounts
Add a new config option, CONFIG_EXT4_USE_FOR_EXT23 which if enabled,
will cause ext4 to be used for either ext2 or ext3 file system mounts
when ext2 or ext3 is not enabled in the configuration.

This allows minimalist kernel fanatics to drop to file system drivers
from their compiled kernel with out losing functionality.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-12-07 14:08:51 -05:00
Roel Kluin c09eef305d ext4: Return the PTR_ERR of the correct pointer in setup_new_group_blocks()
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-12-07 10:38:16 -05:00
Russell King 3d14b5beba Merge branch 'sa1100' into devel 2009-12-06 17:00:33 +00:00
Russell King 1bf8e62195 Fix soc_common PCMCIA configuration
Jonathan Cameron reports that building PCMCIA as modules doesn't work:

As module get a load of undefined symbols:
ERROR: "soc_pcmcia_request_irqs" [drivers/pcmcia/pxa2xx_stargate2.ko] undefined!
ERROR: "soc_pcmcia_free_irqs" [drivers/pcmcia/pxa2xx_stargate2.ko] undefined!
ERROR: "soc_pcmcia_enable_irqs" [drivers/pcmcia/pxa2xx_stargate2.ko] undefined!
ERROR: "soc_pcmcia_disable_irqs" [drivers/pcmcia/pxa2xx_stargate2.ko] undefined!
ERROR: "soc_pcmcia_add_one" [drivers/pcmcia/pxa2xx_base.ko] undefined!
ERROR: "soc_common_pcmcia_get_timing" [drivers/pcmcia/pxa2xx_base.ko] undefined!
ERROR: "soc_pcmcia_remove_one" [drivers/pcmcia/pxa2xx_base.ko] undefined!
make[1]: *** [__modpost] Error 1
make: *** [modules] Error 2

This is because soc_common tries to be built-in, but it should be a module.
Allow soc_common to be a module.

Reported-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-12-06 16:58:50 +00:00
Russell King ba71e17269 Merge branch 'for-lak' of git://git.linuxtogo.org/home/thesing/collie into sa1100 2009-12-06 16:53:12 +00:00
Dmitry Artamonow 729fae44dd ARM: 5827/1: SA1100: h3100/h3600: emit messages on failed gpio_request
Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-12-06 16:52:58 +00:00
Dmitry Artamonow a53c876dc1 ARM: 5826/1: SA1100: h3100/h3600: always build htc-egpio driver
Many features of h3100/h3600 (LCD, PCMCIA, Flash write, etc.)
depend on correct functioning of GPIO expander handled by htc-egpio
driver, so force its building in Kconfig.

Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-12-06 16:52:58 +00:00
Dmitry Artamonow ebdb56409d ARM: 5825/1: SA1100: h3600: update defconfig
Update defconfig to current kernel, enable support for iPAQ H3100
and following drivers: gpio-keys, htc-egpio, ide_cs.

Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-12-06 16:52:57 +00:00
Dmitry Artamonow e7435f866f ARM: 5824/1: SA1100: reuse h3600 PCMCIA driver on h3100
Both iPAQs h3600 and h3100 share the same control
GPIOs for PCMCIA, so driver can be reused.

Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-12-06 16:52:57 +00:00
Dmitry Artamonow c463eb62ac ARM: 5823/1: SA1100: h3100/h3600: add support for gpio-keys
Add support for "Power" and "Action" (joystick center) buttons -
the only buttons on iPaq h3100/h3600 connected to GPIOs
(other buttons are controlled by microcontroller)
Also remove setting PWER for wakeup on Power button press -
gpio-keys driver will handle it.

Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-12-06 16:52:57 +00:00
Dmitry Artamonow 4aa9755580 ARM: 5822/1: SA1100: h3100/h3600: clean up #includes
After a code reorganization and following split, there's some #includes
now unused. Clean them up and sort remaining alphabetticaly where possible.

Compile tested.

Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-12-06 16:52:57 +00:00
Dmitry Artamonow 6e23fcb3bd ARM: 5821/1: SA1100: h3100/h3600: revise copyright boilerplates
Correct boilerplates after files split. Also shorten them a bit - use
standart GPL wording (as per http://lkml.org/lkml/2007/5/1/220) and
drop changelog, which only entry about h3800 support and abstracted
EGPIOs is just confusing now, as both of these features are gone.

Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-12-06 16:52:56 +00:00
Dmitry Artamonow 86e5e38c46 ARM: 5820/1: SA1100: h3100/h3600: split h3600.c
Split common h3600.c into three separate files: h3100.c, h3600.c and
h3xxx.c (the latter contains common code for h3100/h3600)
Copyright boilerplates and #includes are copied intact and will be
cleaned up later.

Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-12-06 16:52:56 +00:00
Dmitry Artamonow 8715b29db2 ARM: 5819/1: SA1100: h3100/h3600: merge h3600.h and h3600_gpio.h into h3xxx.h
Combine both headers into one, rename to h3xxx.h and change all
users accordingly.

Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-12-06 16:52:56 +00:00
Dmitry Artamonow 4c88a5c20f ARM: 5818/1: SA1100: h3100/h3600: drop old GPIO definitions
As all existing code was converted to gpiolib, drop no more
used pre-gpiolib (bit-shifted) GPIO definintions.
Supply new gpiolib-friendly definitions for GPIOs which
don't have them yet.

Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-12-06 16:52:56 +00:00
Dmitry Artamonow 51834901fa ARM: 5817/1: SA1100: h3100/h3600: configure all unused gpios as inputs
After conversion to gpiolib there's still some GPIOs left, that get
configured in *_mach_init() as outputs (using direct operations
on GPCR/GPDR registers), but otherwise unused. These GPIOs are mainly
sound related and should be configured by corresponding driver once
it is written.

Drop this initialisation and configure all GPIOs as input.

Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-12-06 16:52:55 +00:00
Dmitry Artamonow ca912b17c0 ARM: 5816/1: SA1100: h3600: remove IRQ_GPIO_* definitions
As all the remaining users of these definitions
(in pcmcia/sa1100_h3600 driver) were converted to gpio_to_irq(),
they can be safely removed.

Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-12-06 16:52:55 +00:00
Dmitry Artamonow 766f0378a7 ARM: 5815/1: SA1100: h3100/h3600: remove now unused assign_h3600_egpio handlers
As all users of assign_h3600_egpio now converted to gpiolib, we
can safely remove all assign_h3600_egpio handling code and
definitions.

Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-12-06 16:52:55 +00:00
Dmitry Artamonow 22f9740552 ARM: 5814/1: SA1100: h3100/h3600: convert all users of assign_h3600_egpio to gpiolib
Use of gpio_request/gpio_free in some callbacks may look ugly, but
corresponding drivers (sa1100_serial and sa1100_fb) don't provide (yet)
init/exit hooks and registering these gpios in *_mach_init is also
not possible, because htc-gpio driver starts a bit later...

Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-12-06 16:52:55 +00:00
Dmitry Artamonow 2eec62d7db ARM: 5813/1: SA1100: h3100/h3600: add htc-egpio driver
It will be used for future conversion of assign_h3600_egpio calls to
gpiolib.

Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-12-06 16:52:55 +00:00
Dmitry Artamonow cf5a87d80a ARM: 5812/1: SA1100: h3100/h3600: separate machine-specific LCD helpers
h3100 and h3600 have different sets of LCD-controlling gpios,
which mapped to the same "abstracted" EGPIO.
As we plan to get rid of those abstracted egpios completely, we
need to separate these helper functions.

Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-12-06 16:52:54 +00:00
Dmitry Artamonow 2a83709199 ARM: 5811/2: pcmcia: convert sa1100_h3600 driver to gpiolib
Convert all operations with GPLR/GPCR/GPSR to gpiolibs calls.
Also change all IRQ_GPIO* to gpio_to_irq(*GPIO*)

Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-12-06 16:52:36 +00:00
Dmitry Artamonow d0e6041efd ARM: 5799/1: SA1100: h3600: stop setting direction for LCD pins
sa1100_fb driver handles this

Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-12-06 16:52:26 +00:00
Dmitry Artamonow 382c14a52d ARM: 5798/1: SA1100: h3600: remove unused cruft from h3600.h
PM_SUSPEND, PM_RESUME and machine_is_h3xxx() are not used anywhere in
kernel (checked with git grep), so it's safe to remove them.

Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-12-06 16:52:25 +00:00
Dmitry Artamonow 2a151a0f12 ARM: 5796/1: SA1100: h3600: remove IRDA bits from serial PM callback
IRDA is handled by separate sa1100-ir driver and has
nothing to do with sa1100_serial

Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-12-06 16:52:25 +00:00
Dmitry Artamonow 1e23221e98 ARM: 5797/1: SA1100: h3100/h3600: remove dead links from Kconfig help text
Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-12-06 16:52:25 +00:00
Dmitry Artamonow e55b20e81d ARM: 5795/1: SA1100: h3100/h3600: mark *_mach_init functions as __init
Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-12-06 16:52:25 +00:00
Russell King 0fb85a5aa0 ARM: iPAQ: no need to set PWER_RTC
The rtc-sa1100 driver takes care of this.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-12-06 16:52:25 +00:00
Russell King 6e21ee6aa7 ARM: iPAQ: move serial port support functions
No point calling sa1100_register_uart_fns early - these aren't
used until late in the boot sequence.  Also convert to gpiolib
support.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-12-06 16:52:24 +00:00
Russell King 9c196f0f8d ARM: iPAQ: convert H3100 IrDA to use generic gpio support
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-12-06 16:52:24 +00:00
Russell King 0831e3e4cf ARM: iPAQ: provide a way to setup platform-controlled GPIOs
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-12-06 16:52:24 +00:00
Russell King a5d176a191 ARM: iPAQ: separate IrDA machine specifics
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-12-06 16:52:24 +00:00
Russell King 898e810ead ARM: h3600: provide each iPAQ machine type with own init function
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-12-06 16:52:24 +00:00
Russell King 7a5b4e16c8 ARM: sa11x0: convert set_xxx_data() to register_xxx()
Only register devices if we have platform data for those which require
platform data.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-12-06 16:52:23 +00:00
Jean Delvare 6471b68982 i2c-stub: Documentation update
There is nothing sensors-specific to i2c-stub.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-12-06 17:06:30 +01:00
Jean Delvare 38f41f282f i2c-stub: Allow user to disable some commands
Add a module parameter to override the functionality bitfield. This
lets the user disable some commands. This can be used to force a chip
driver to take different code paths.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-12-06 17:06:29 +01:00
Jean Delvare 4710317891 i2c-stub: Implement I2C block support
This is required to test some drivers, for example at24.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-12-06 17:06:28 +01:00
Jean Delvare 69b0089a67 i2c: Refactor for_each callbacks
Functions i2c_do_add_adapter() and __attach_adapter() do essentially
the same thing, differing only in how the parameters are passed. Same
for i2c_do_add_adapter() and __detach_adapter(). Introduce wrappers to
normalize the parameters, so that we do not have to duplicate the
code.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: David Brownell <dbrownell@users.sourceforge.net>
2009-12-06 17:06:27 +01:00
Jean Delvare 7e2193a8f9 i2c-i801: Retry on lost arbitration
The Intel 82801 is sometimes used on systems with a BMC connected. The
BMC can access the SMBus, resulting in lost arbitration for the 82801.
We should let i2c-core retry transactions for us in this case.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-12-06 17:06:27 +01:00
Vincent Sanders 9669f54194 i2c: Remove big kernel lock from i2cdev_open
The BKL is held over a kmalloc so cannot protect anything beyond that.
The two calls before the kmalloc have their own locking.
Improve device open function by removing the now unnecessary ret variable

Signed-off-by: Vincent Sanders <vince@simtec.co.uk>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-12-06 17:06:26 +01:00
Jean Delvare c2e90e9b68 ics932s401: Clean up detect function
As kind is now hard-coded to -1, there is room for code clean-ups.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: "Darrick J. Wong" <djwong@us.ibm.com>
2009-12-06 17:06:26 +01:00