Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'for-4.15-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux

Pull btrfs fix from David Sterba:
"It's been reported recently that readdir can list stale entries under
some conditions. Fix it."

* tag 'for-4.15-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
Btrfs: fix stale entries in readdir

+8 -18
+8 -18
fs/btrfs/delayed-inode.c
··· 1633 1633 int btrfs_should_delete_dir_index(struct list_head *del_list, 1634 1634 u64 index) 1635 1635 { 1636 - struct btrfs_delayed_item *curr, *next; 1637 - int ret; 1636 + struct btrfs_delayed_item *curr; 1637 + int ret = 0; 1638 1638 1639 - if (list_empty(del_list)) 1640 - return 0; 1641 - 1642 - list_for_each_entry_safe(curr, next, del_list, readdir_list) { 1639 + list_for_each_entry(curr, del_list, readdir_list) { 1643 1640 if (curr->key.offset > index) 1644 1641 break; 1645 - 1646 - list_del(&curr->readdir_list); 1647 - ret = (curr->key.offset == index); 1648 - 1649 - if (refcount_dec_and_test(&curr->refs)) 1650 - kfree(curr); 1651 - 1652 - if (ret) 1653 - return 1; 1654 - else 1655 - continue; 1642 + if (curr->key.offset == index) { 1643 + ret = 1; 1644 + break; 1645 + } 1656 1646 } 1657 - return 0; 1647 + return ret; 1658 1648 } 1659 1649 1660 1650 /*