diff options
| -rw-r--r-- | fs/btrfs/tree-log.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index 9f6372dd0eab..9d2e8ecc5382 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c | |||
| @@ -4500,7 +4500,22 @@ static int btrfs_log_inode(struct btrfs_trans_handle *trans, | |||
| 4500 | 4500 | ||
| 4501 | mutex_lock(&BTRFS_I(inode)->log_mutex); | 4501 | mutex_lock(&BTRFS_I(inode)->log_mutex); |
| 4502 | 4502 | ||
| 4503 | btrfs_get_logged_extents(inode, &logged_list, start, end); | 4503 | /* |
| 4504 | * Collect ordered extents only if we are logging data. This is to | ||
| 4505 | * ensure a subsequent request to log this inode in LOG_INODE_ALL mode | ||
| 4506 | * will process the ordered extents if they still exists at the time, | ||
| 4507 | * because when we collect them we test and set for the flag | ||
| 4508 | * BTRFS_ORDERED_LOGGED to prevent multiple log requests to process the | ||
| 4509 | * same ordered extents. The consequence for the LOG_INODE_ALL log mode | ||
| 4510 | * not processing the ordered extents is that we end up logging the | ||
| 4511 | * corresponding file extent items, based on the extent maps in the | ||
| 4512 | * inode's extent_map_tree's modified_list, without logging the | ||
| 4513 | * respective checksums (since the may still be only attached to the | ||
| 4514 | * ordered extents and have not been inserted in the csum tree by | ||
| 4515 | * btrfs_finish_ordered_io() yet). | ||
| 4516 | */ | ||
| 4517 | if (inode_only == LOG_INODE_ALL) | ||
| 4518 | btrfs_get_logged_extents(inode, &logged_list, start, end); | ||
| 4504 | 4519 | ||
| 4505 | /* | 4520 | /* |
| 4506 | * a brute force approach to making sure we get the most uptodate | 4521 | * a brute force approach to making sure we get the most uptodate |
