Commit 8679d26
btrfs: initialize inode::file_extent_tree after i_mode has been set
btrfs_init_file_extent_tree() uses S_ISREG() to determine if the file is
a regular file. In the beginning of btrfs_read_locked_inode(), the i_mode
hasn't been read from inode item, then file_extent_tree won't be used at
all in volumes without NO_HOLES.
Fix this by calling btrfs_init_file_extent_tree() after i_mode is
initialized in btrfs_read_locked_inode().
Fixes: 3d7db6e ("btrfs: don't allocate file extent tree for non regular files")
CC: stable@vger.kernel.org # 6.12+
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: austinchang <austinchang@synology.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>1 parent 5b8d296 commit 8679d26
2 files changed
+5
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1843 | 1843 | | |
1844 | 1844 | | |
1845 | 1845 | | |
1846 | | - | |
1847 | 1846 | | |
1848 | 1847 | | |
1849 | 1848 | | |
| |||
1864 | 1863 | | |
1865 | 1864 | | |
1866 | 1865 | | |
1867 | | - | |
1868 | | - | |
1869 | 1866 | | |
1870 | 1867 | | |
1871 | 1868 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3885 | 3885 | | |
3886 | 3886 | | |
3887 | 3887 | | |
3888 | | - | |
3889 | | - | |
3890 | | - | |
3891 | | - | |
3892 | 3888 | | |
3893 | 3889 | | |
3894 | 3890 | | |
| |||
3920 | 3916 | | |
3921 | 3917 | | |
3922 | 3918 | | |
3923 | | - | |
3924 | | - | |
3925 | 3919 | | |
3926 | 3920 | | |
3927 | 3921 | | |
| |||
3953 | 3947 | | |
3954 | 3948 | | |
3955 | 3949 | | |
| 3950 | + | |
| 3951 | + | |
| 3952 | + | |
| 3953 | + | |
| 3954 | + | |
3956 | 3955 | | |
3957 | 3956 | | |
3958 | 3957 | | |
| |||
0 commit comments