--- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c @@ -6492,8 +6492,8 @@ void btrfs_log_new_name(struct btrfs_tra * if this inode hasn't been logged and directory we're renaming it * from hasn't been logged, we don't need to log it */ - if (inode->logged_trans < trans->transid && - (!old_dir || old_dir->logged_trans < trans->transid)) + if (!inode_logged(trans, inode) && + (!old_dir || !inode_logged(trans, old_dir))) return; /*