]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
fs/mpage.c: fix mpage_writepage() for pages with buffers
authorMatthew Wilcox <willy@infradead.org>
Fri, 13 Oct 2017 22:58:15 +0000 (15:58 -0700)
committerSeth Forshee <seth.forshee@canonical.com>
Thu, 19 Oct 2017 14:49:32 +0000 (09:49 -0500)
commit5330704d7b852fce4bab77b312df7f3ac0345a5e
tree0696c25991df4635fd3398ebc1f4a3a42359bfd9
parent4ee6850c1dd2794dcc2e5212abf8ae11f86b00c6
fs/mpage.c: fix mpage_writepage() for pages with buffers

BugLink: http://bugs.launchpad.net/bugs/1724669
commit f892760aa66a2d657deaf59538fb69433036767c upstream.

When using FAT on a block device which supports rw_page, we can hit
BUG_ON(!PageLocked(page)) in try_to_free_buffers().  This is because we
call clean_buffers() after unlocking the page we've written.  Introduce
a new clean_page_buffers() which cleans all buffers associated with a
page and call it from within bdev_write_page().

[akpm@linux-foundation.org: s/PAGE_SIZE/~0U/ per Linus and Matthew]
Link: http://lkml.kernel.org/r/20171006211541.GA7409@bombadil.infradead.org
Signed-off-by: Matthew Wilcox <mawilcox@microsoft.com>
Reported-by: Toshi Kani <toshi.kani@hpe.com>
Reported-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Tested-by: Toshi Kani <toshi.kani@hpe.com>
Acked-by: Johannes Thumshirn <jthumshirn@suse.de>
Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
fs/block_dev.c
fs/mpage.c
include/linux/buffer_head.h