|
@@ -5278,11 +5278,16 @@ static int btrfs_log_all_parents(struct btrfs_trans_handle *trans,
|
|
if (IS_ERR(dir_inode))
|
|
if (IS_ERR(dir_inode))
|
|
continue;
|
|
continue;
|
|
|
|
|
|
|
|
+ if (ctx)
|
|
|
|
+ ctx->log_new_dentries = false;
|
|
ret = btrfs_log_inode(trans, root, dir_inode,
|
|
ret = btrfs_log_inode(trans, root, dir_inode,
|
|
LOG_INODE_ALL, 0, LLONG_MAX, ctx);
|
|
LOG_INODE_ALL, 0, LLONG_MAX, ctx);
|
|
if (!ret &&
|
|
if (!ret &&
|
|
btrfs_must_commit_transaction(trans, dir_inode))
|
|
btrfs_must_commit_transaction(trans, dir_inode))
|
|
ret = 1;
|
|
ret = 1;
|
|
|
|
+ if (!ret && ctx && ctx->log_new_dentries)
|
|
|
|
+ ret = log_new_dir_dentries(trans, root,
|
|
|
|
+ dir_inode, ctx);
|
|
iput(dir_inode);
|
|
iput(dir_inode);
|
|
if (ret)
|
|
if (ret)
|
|
goto out;
|
|
goto out;
|
|
@@ -5652,11 +5657,9 @@ void btrfs_record_unlink_dir(struct btrfs_trans_handle *trans,
|
|
* into the file. When the file is logged we check it and
|
|
* into the file. When the file is logged we check it and
|
|
* don't log the parents if the file is fully on disk.
|
|
* don't log the parents if the file is fully on disk.
|
|
*/
|
|
*/
|
|
- if (S_ISREG(inode->i_mode)) {
|
|
|
|
- mutex_lock(&BTRFS_I(inode)->log_mutex);
|
|
|
|
- BTRFS_I(inode)->last_unlink_trans = trans->transid;
|
|
|
|
- mutex_unlock(&BTRFS_I(inode)->log_mutex);
|
|
|
|
- }
|
|
|
|
|
|
+ mutex_lock(&BTRFS_I(inode)->log_mutex);
|
|
|
|
+ BTRFS_I(inode)->last_unlink_trans = trans->transid;
|
|
|
|
+ mutex_unlock(&BTRFS_I(inode)->log_mutex);
|
|
|
|
|
|
/*
|
|
/*
|
|
* if this directory was already logged any new
|
|
* if this directory was already logged any new
|