inode.c (16ba7e312045cd5d32fba0156312b4303f200787) inode.c (9e52484c713321e84e8834803a44ca0a001376d2)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * linux/fs/ext4/inode.c
4 *
5 * Copyright (C) 1992, 1993, 1994, 1995
6 * Remy Card (card@masi.ibp.fr)
7 * Laboratoire MASI - Institut Blaise Pascal
8 * Universite Pierre et Marie Curie (Paris VI)

--- 418 unchanged lines hidden (view full) ---

427 * There is a race window that the result is not the same.
428 * e.g. xfstests #223 when dioread_nolock enables. The reason
429 * is that we lookup a block mapping in extent status tree with
430 * out taking i_data_sem. So at the time the unwritten extent
431 * could be converted.
432 */
433 down_read(&EXT4_I(inode)->i_data_sem);
434 if (ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS)) {
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * linux/fs/ext4/inode.c
4 *
5 * Copyright (C) 1992, 1993, 1994, 1995
6 * Remy Card (card@masi.ibp.fr)
7 * Laboratoire MASI - Institut Blaise Pascal
8 * Universite Pierre et Marie Curie (Paris VI)

--- 418 unchanged lines hidden (view full) ---

427 * There is a race window that the result is not the same.
428 * e.g. xfstests #223 when dioread_nolock enables. The reason
429 * is that we lookup a block mapping in extent status tree with
430 * out taking i_data_sem. So at the time the unwritten extent
431 * could be converted.
432 */
433 down_read(&EXT4_I(inode)->i_data_sem);
434 if (ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS)) {
435 retval = ext4_ext_map_blocks(handle, inode, map, flags &
436 EXT4_GET_BLOCKS_KEEP_SIZE);
435 retval = ext4_ext_map_blocks(handle, inode, map, 0);
437 } else {
436 } else {
438 retval = ext4_ind_map_blocks(handle, inode, map, flags &
439 EXT4_GET_BLOCKS_KEEP_SIZE);
437 retval = ext4_ind_map_blocks(handle, inode, map, 0);
440 }
441 up_read((&EXT4_I(inode)->i_data_sem));
442
443 /*
444 * We don't check m_len because extent will be collpased in status
445 * tree. So the m_len might not equal.
446 */
447 if (es_map->m_lblk != map->m_lblk ||

--- 88 unchanged lines hidden (view full) ---

536 }
537
538 /*
539 * Try to see if we can get the block without requesting a new
540 * file system block.
541 */
542 down_read(&EXT4_I(inode)->i_data_sem);
543 if (ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS)) {
438 }
439 up_read((&EXT4_I(inode)->i_data_sem));
440
441 /*
442 * We don't check m_len because extent will be collpased in status
443 * tree. So the m_len might not equal.
444 */
445 if (es_map->m_lblk != map->m_lblk ||

--- 88 unchanged lines hidden (view full) ---

534 }
535
536 /*
537 * Try to see if we can get the block without requesting a new
538 * file system block.
539 */
540 down_read(&EXT4_I(inode)->i_data_sem);
541 if (ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS)) {
544 retval = ext4_ext_map_blocks(handle, inode, map, flags &
545 EXT4_GET_BLOCKS_KEEP_SIZE);
542 retval = ext4_ext_map_blocks(handle, inode, map, 0);
546 } else {
543 } else {
547 retval = ext4_ind_map_blocks(handle, inode, map, flags &
548 EXT4_GET_BLOCKS_KEEP_SIZE);
544 retval = ext4_ind_map_blocks(handle, inode, map, 0);
549 }
550 if (retval > 0) {
551 unsigned int status;
552
553 if (unlikely(retval != map->m_len)) {
554 ext4_warning(inode->i_sb,
555 "ES len assertion failed for inode "
556 "%lu: retval %d != map->m_len %d",

--- 5481 unchanged lines hidden ---
545 }
546 if (retval > 0) {
547 unsigned int status;
548
549 if (unlikely(retval != map->m_len)) {
550 ext4_warning(inode->i_sb,
551 "ES len assertion failed for inode "
552 "%lu: retval %d != map->m_len %d",

--- 5481 unchanged lines hidden ---