Why does mpage_writepage() not handle locked buffers?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I tried this:

-static int blkdev_writepage(struct page *page, struct writeback_control *wbc)
+static int blkdev_writepages(struct address_space *mapping,
+               struct writeback_control *wbc)
 {
-       return block_write_full_page(page, blkdev_get_block, wbc);
+       return mpage_writepages(mapping, wbc, blkdev_get_block);
 }

and I hit the BUG_ON(buffer_locked(bh)); in __mpage_writepage() which
has been there since you added it in 2002.

block_write_full_page() handles this fine, so why isn't this

	if (buffer_locked(bh))
		goto confused;

Is the thought that we hold the folio locked, therefore no buffers
should be locked at this time?  I don't know the rules.

In case it's relevant, I hit this while running xfstests generic/013
with ext4 and the stack backtrace is:

__mpage_writepage+0x18d/0x7c0
 write_cache_pages+0x17e/0x480
 mpage_writepages+0x44/0x80
 blkdev_writepages+0x10/0x20
 do_writepages+0xa9/0x150
 filemap_fdatawrite+0x70/0x80
 sync_bdevs+0x151/0x160
 ksys_sync+0x55/0x80





[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux