1
0
Fork 0
remarkable-linux/fs/ubifs
Kirill A. Shutemov f3d1ae6f55 UBIFS: Implement ->migratepage()
[ Upstream commit 4ac1c17b20 ]

During page migrations UBIFS might get confused
and the following assert triggers:
[  213.480000] UBIFS assert failed in ubifs_set_page_dirty at 1451 (pid 436)
[  213.490000] CPU: 0 PID: 436 Comm: drm-stress-test Not tainted 4.4.4-00176-geaa802524636-dirty #1008
[  213.490000] Hardware name: Allwinner sun4i/sun5i Families
[  213.490000] [<c0015e70>] (unwind_backtrace) from [<c0012cdc>] (show_stack+0x10/0x14)
[  213.490000] [<c0012cdc>] (show_stack) from [<c02ad834>] (dump_stack+0x8c/0xa0)
[  213.490000] [<c02ad834>] (dump_stack) from [<c0236ee8>] (ubifs_set_page_dirty+0x44/0x50)
[  213.490000] [<c0236ee8>] (ubifs_set_page_dirty) from [<c00fa0bc>] (try_to_unmap_one+0x10c/0x3a8)
[  213.490000] [<c00fa0bc>] (try_to_unmap_one) from [<c00fadb4>] (rmap_walk+0xb4/0x290)
[  213.490000] [<c00fadb4>] (rmap_walk) from [<c00fb1bc>] (try_to_unmap+0x64/0x80)
[  213.490000] [<c00fb1bc>] (try_to_unmap) from [<c010dc28>] (migrate_pages+0x328/0x7a0)
[  213.490000] [<c010dc28>] (migrate_pages) from [<c00d0cb0>] (alloc_contig_range+0x168/0x2f4)
[  213.490000] [<c00d0cb0>] (alloc_contig_range) from [<c010ec00>] (cma_alloc+0x170/0x2c0)
[  213.490000] [<c010ec00>] (cma_alloc) from [<c001a958>] (__alloc_from_contiguous+0x38/0xd8)
[  213.490000] [<c001a958>] (__alloc_from_contiguous) from [<c001ad44>] (__dma_alloc+0x23c/0x274)
[  213.490000] [<c001ad44>] (__dma_alloc) from [<c001ae08>] (arm_dma_alloc+0x54/0x5c)
[  213.490000] [<c001ae08>] (arm_dma_alloc) from [<c035cecc>] (drm_gem_cma_create+0xb8/0xf0)
[  213.490000] [<c035cecc>] (drm_gem_cma_create) from [<c035cf20>] (drm_gem_cma_create_with_handle+0x1c/0xe8)
[  213.490000] [<c035cf20>] (drm_gem_cma_create_with_handle) from [<c035d088>] (drm_gem_cma_dumb_create+0x3c/0x48)
[  213.490000] [<c035d088>] (drm_gem_cma_dumb_create) from [<c0341ed8>] (drm_ioctl+0x12c/0x444)
[  213.490000] [<c0341ed8>] (drm_ioctl) from [<c0121adc>] (do_vfs_ioctl+0x3f4/0x614)
[  213.490000] [<c0121adc>] (do_vfs_ioctl) from [<c0121d30>] (SyS_ioctl+0x34/0x5c)
[  213.490000] [<c0121d30>] (SyS_ioctl) from [<c000f2c0>] (ret_fast_syscall+0x0/0x34)

UBIFS is using PagePrivate() which can have different meanings across
filesystems. Therefore the generic page migration code cannot handle this
case correctly.
We have to implement our own migration function which basically does a
plain copy but also duplicates the page private flag.
UBIFS is not a block device filesystem and cannot use buffer_migrate_page().

Cc: stable@vger.kernel.org
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
[rw: Massaged changelog, build fixes, etc...]
Signed-off-by: Richard Weinberger <richard@nod.at>
Acked-by: Christoph Hellwig <hch@lst.de>

Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2016-07-10 20:20:02 -04:00
..
Kconfig UBIFS: remove Kconfig debugging option 2012-05-16 19:53:46 +03:00
Makefile UBIFS: remove Kconfig debugging option 2012-05-16 19:53:46 +03:00
budget.c UBIFS: extend debug/message capabilities 2015-03-25 11:08:41 +02:00
commit.c UBIFS: extend debug/message capabilities 2015-03-25 11:08:41 +02:00
compress.c UBIFS: extend debug/message capabilities 2015-03-25 11:08:41 +02:00
debug.c UBIFS: extend debug/message capabilities 2015-03-25 11:08:41 +02:00
debug.h UBIFS: print less 2012-08-31 17:32:58 +03:00
dir.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2015-04-26 17:22:07 -07:00
file.c UBIFS: Implement ->migratepage() 2016-07-10 20:20:02 -04:00
find.c UBIFS: fix mounting problems after power cuts 2012-10-26 16:26:44 +03:00
gc.c UBIFS: remove unnecessary code in ubifs_garbage_collect 2013-10-22 13:34:27 +01:00
io.c UBIFS: extend debug/message capabilities 2015-03-25 11:08:41 +02:00
ioctl.c UBIFS: extend debug/message capabilities 2015-03-25 11:08:41 +02:00
journal.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2015-04-26 17:22:07 -07:00
key.h UBIFS: mark unused key objects as invalid 2010-08-30 10:19:08 +03:00
log.c UBIFS: extend debug/message capabilities 2015-03-25 11:08:41 +02:00
lprops.c UBIFS: extend debug/message capabilities 2015-03-25 11:08:41 +02:00
lpt.c UBIFS: extend debug/message capabilities 2015-03-25 11:08:41 +02:00
lpt_commit.c UBIFS: extend debug/message capabilities 2015-03-25 11:08:41 +02:00
master.c UBIFS: extend debug/message capabilities 2015-03-25 11:08:41 +02:00
misc.h Revert "UBIFS: add a log overlap assertion" 2014-07-28 19:15:19 +03:00
orphan.c UBIFS: extend debug/message capabilities 2015-03-25 11:08:41 +02:00
recovery.c UBIFS: extend debug/message capabilities 2015-03-25 11:08:41 +02:00
replay.c UBIFS: extend debug/message capabilities 2015-03-25 11:08:41 +02:00
sb.c UBIFS: extend debug/message capabilities 2015-03-25 11:08:41 +02:00
scan.c UBIFS: extend debug/message capabilities 2015-03-25 11:08:41 +02:00
shrinker.c UBIFS: Remove incorrect assertion in shrink_tnc() 2014-06-02 11:28:24 +03:00
super.c UBIFS: extend debug/message capabilities 2015-03-25 11:08:41 +02:00
tnc.c UBIFS: extend debug/message capabilities 2015-03-25 11:08:41 +02:00
tnc_commit.c UBIFS: extend debug/message capabilities 2015-03-25 11:08:41 +02:00
tnc_misc.c UBIFS: extend debug/message capabilities 2015-03-25 11:08:41 +02:00
ubifs-media.h UBIFS: add a superblock flag for free space fix-up 2011-05-16 14:12:14 +03:00
ubifs.h UBIFS: extend debug/message capabilities 2015-03-25 11:08:41 +02:00
xattr.c UBIFS: Kill unneeded locking in ubifs_init_security 2015-10-22 14:43:24 -07:00