diff options
author | Jan Kara <jack@suse.cz> | 2014-02-28 03:31:10 -0500 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2014-03-04 06:19:26 -0500 |
commit | d680104f3d488ff028f7dd03b0bc055aa5e8ad8d (patch) | |
tree | d6d5c478c383f38240dc7e946a7651d7b2463310 /fs/ext3 | |
parent | 99128addc964d4429d1bb9be5fa9e03ce85b1e68 (diff) |
ext3: Update outdated comment before ext3_ordered_writepage()
The comment is heavily outdated. The recursion into the filesystem isn't
possible because we use GFP_NOFS for our allocations, the issue about
block_write_full_page() dirtying tail page is long resolved as well
(that function doesn't dirty buffers at all), and finally we don't start
a transaction if all blocks are already allocated and mapped.
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/ext3')
-rw-r--r-- | fs/ext3/inode.c | 47 |
1 files changed, 4 insertions, 43 deletions
diff --git a/fs/ext3/inode.c b/fs/ext3/inode.c index 2fef98abb207..4ecf88fb69a8 100644 --- a/fs/ext3/inode.c +++ b/fs/ext3/inode.c | |||
@@ -1559,56 +1559,17 @@ static int buffer_unmapped(handle_t *handle, struct buffer_head *bh) | |||
1559 | } | 1559 | } |
1560 | 1560 | ||
1561 | /* | 1561 | /* |
1562 | * Note that we always start a transaction even if we're not journalling | 1562 | * Note that whenever we need to map blocks we start a transaction even if |
1563 | * data. This is to preserve ordering: any hole instantiation within | 1563 | * we're not journalling data. This is to preserve ordering: any hole |
1564 | * __block_write_full_page -> ext3_get_block() should be journalled | 1564 | * instantiation within __block_write_full_page -> ext3_get_block() should be |
1565 | * along with the data so we don't crash and then get metadata which | 1565 | * journalled along with the data so we don't crash and then get metadata which |
1566 | * refers to old data. | 1566 | * refers to old data. |
1567 | * | 1567 | * |
1568 | * In all journalling modes block_write_full_page() will start the I/O. | 1568 | * In all journalling modes block_write_full_page() will start the I/O. |
1569 | * | 1569 | * |
1570 | * Problem: | ||
1571 | * | ||
1572 | * ext3_writepage() -> kmalloc() -> __alloc_pages() -> page_launder() -> | ||
1573 | * ext3_writepage() | ||
1574 | * | ||
1575 | * Similar for: | ||
1576 | * | ||
1577 | * ext3_file_write() -> generic_file_write() -> __alloc_pages() -> ... | ||
1578 | * | ||
1579 | * Same applies to ext3_get_block(). We will deadlock on various things like | ||
1580 | * lock_journal and i_truncate_mutex. | ||
1581 | * | ||
1582 | * Setting PF_MEMALLOC here doesn't work - too many internal memory | ||
1583 | * allocations fail. | ||
1584 | * | ||
1585 | * 16May01: If we're reentered then journal_current_handle() will be | ||
1586 | * non-zero. We simply *return*. | ||
1587 | * | ||
1588 | * 1 July 2001: @@@ FIXME: | ||
1589 | * In journalled data mode, a data buffer may be metadata against the | ||
1590 | * current transaction. But the same file is part of a shared mapping | ||
1591 | * and someone does a writepage() on it. | ||
1592 | * | ||
1593 | * We will move the buffer onto the async_data list, but *after* it has | ||
1594 | * been dirtied. So there's a small window where we have dirty data on | ||
1595 | * BJ_Metadata. | ||
1596 | * | ||
1597 | * Note that this only applies to the last partial page in the file. The | ||
1598 | * bit which block_write_full_page() uses prepare/commit for. (That's | ||
1599 | * broken code anyway: it's wrong for msync()). | ||
1600 | * | ||
1601 | * It's a rare case: affects the final partial page, for journalled data | ||
1602 | * where the file is subject to bith write() and writepage() in the same | ||
1603 | * transction. To fix it we'll need a custom block_write_full_page(). | ||
1604 | * We'll probably need that anyway for journalling writepage() output. | ||
1605 | * | ||
1606 | * We don't honour synchronous mounts for writepage(). That would be | 1570 | * We don't honour synchronous mounts for writepage(). That would be |
1607 | * disastrous. Any write() or metadata operation will sync the fs for | 1571 | * disastrous. Any write() or metadata operation will sync the fs for |
1608 | * us. | 1572 | * us. |
1609 | * | ||
1610 | * AKPM2: if all the page's buffers are mapped to disk and !data=journal, | ||
1611 | * we don't need to open a transaction here. | ||
1612 | */ | 1573 | */ |
1613 | static int ext3_ordered_writepage(struct page *page, | 1574 | static int ext3_ordered_writepage(struct page *page, |
1614 | struct writeback_control *wbc) | 1575 | struct writeback_control *wbc) |