diff options
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r-- | fs/btrfs/inode.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 87f1e0cf26f..447612d3a16 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -2509,6 +2509,11 @@ static void btrfs_read_locked_inode(struct inode *inode) | |||
2509 | int maybe_acls; | 2509 | int maybe_acls; |
2510 | u32 rdev; | 2510 | u32 rdev; |
2511 | int ret; | 2511 | int ret; |
2512 | bool filled = false; | ||
2513 | |||
2514 | ret = btrfs_fill_inode(inode, &rdev); | ||
2515 | if (!ret) | ||
2516 | filled = true; | ||
2512 | 2517 | ||
2513 | path = btrfs_alloc_path(); | 2518 | path = btrfs_alloc_path(); |
2514 | BUG_ON(!path); | 2519 | BUG_ON(!path); |
@@ -2520,6 +2525,10 @@ static void btrfs_read_locked_inode(struct inode *inode) | |||
2520 | goto make_bad; | 2525 | goto make_bad; |
2521 | 2526 | ||
2522 | leaf = path->nodes[0]; | 2527 | leaf = path->nodes[0]; |
2528 | |||
2529 | if (filled) | ||
2530 | goto cache_acl; | ||
2531 | |||
2523 | inode_item = btrfs_item_ptr(leaf, path->slots[0], | 2532 | inode_item = btrfs_item_ptr(leaf, path->slots[0], |
2524 | struct btrfs_inode_item); | 2533 | struct btrfs_inode_item); |
2525 | if (!leaf->map_token) | 2534 | if (!leaf->map_token) |
@@ -2556,7 +2565,7 @@ static void btrfs_read_locked_inode(struct inode *inode) | |||
2556 | 2565 | ||
2557 | BTRFS_I(inode)->index_cnt = (u64)-1; | 2566 | BTRFS_I(inode)->index_cnt = (u64)-1; |
2558 | BTRFS_I(inode)->flags = btrfs_inode_flags(leaf, inode_item); | 2567 | BTRFS_I(inode)->flags = btrfs_inode_flags(leaf, inode_item); |
2559 | 2568 | cache_acl: | |
2560 | /* | 2569 | /* |
2561 | * try to precache a NULL acl entry for files that don't have | 2570 | * try to precache a NULL acl entry for files that don't have |
2562 | * any xattrs or acls | 2571 | * any xattrs or acls |
@@ -2572,7 +2581,6 @@ static void btrfs_read_locked_inode(struct inode *inode) | |||
2572 | } | 2581 | } |
2573 | 2582 | ||
2574 | btrfs_free_path(path); | 2583 | btrfs_free_path(path); |
2575 | inode_item = NULL; | ||
2576 | 2584 | ||
2577 | switch (inode->i_mode & S_IFMT) { | 2585 | switch (inode->i_mode & S_IFMT) { |
2578 | case S_IFREG: | 2586 | case S_IFREG: |