From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f172.google.com (mail-pg1-f172.google.com [209.85.215.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 266E7274FD0 for ; Sat, 17 Jan 2026 08:59:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768640389; cv=none; b=p0VYTzZ5+xwx2Jpy6ASJcO39ryrDzZPqVBwGOWPZD7SCxenOxbueiftCNLiJxkvw1V2TYEwXjVV5kTrd1k8y/f//dv4znpKkmo/6BraSAlB4KAa41R4XK8qE79pR3Ptfwq1Jg/9rQQCAv8dfEAnsNrsWPXHJ2G5jred/7yEp0YM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768640389; c=relaxed/simple; bh=r9k7Sm/BNoslvOvU/HrfL6D+oM8FsIbvfesNKK2U+Is=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=B5xAIL7qq5XNbq97VOlniBBSP51GEyxF+q7Rm+7sRxYenUZXLSzB469LMK9h6hd7UyMD5rmHSZr9dOSUIaiE1jT2alv5+JtonY8Jy+oSTXcwfTQMa5xAksSWrQVcDFB06Q1Vt8HZfVzNH4aKYYvyWVUvqCSdRR/2zmJn5kJeziw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=OC9EapxV; arc=none smtp.client-ip=209.85.215.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="OC9EapxV" Received: by mail-pg1-f172.google.com with SMTP id 41be03b00d2f7-bbf2c3eccc9so1505714a12.0 for ; Sat, 17 Jan 2026 00:59:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1768640387; x=1769245187; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=MQKtFx9Go+TUS9fb3gQWfT5aIO81SmUPaLrxb+LyPb0=; b=OC9EapxVzBs4OatBh8mgsfurwwG24Gzem3SJ4bw33YpA8r3rpYOR5GCo8i69b0EBYA MMloVkl0lQy5Gq5mo27IPeH0F2PcXaHpRhoiHygPrWyoenmzc4iY0JM8bA4N/wd+Bti5 XmZkCB+6R0YJ0ZoGoJeWMqLjrczGyK1a0tbugsMm8iQl2ycUU+12FHHNxwXMKh9+kzbg Dp4I9gIW9f9wqLeAo5U8Mz7zbP2AReQOuLPgxUSaFu+Q+hiMWI+jhI5sgSz8l4ww7CZ+ gdXU05aogcnr0zbx24HzYqSm7pH2HStD4cXEreaPFEJeptjRJGVfp/Wmln82+eCQ3zSE AY6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768640387; x=1769245187; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=MQKtFx9Go+TUS9fb3gQWfT5aIO81SmUPaLrxb+LyPb0=; b=qRZ1qQzzQX8SGWUaYYLftvl/qBweqsRIH52oQqX6mUXMgw+9RJ99M/q6DhUZkpSRHz yskYhQ7xIyTLLaRqZu/ocXaJxMPoBz/LncbzKD0UqJQkNpjbf2SFJWB08f2TargEMUU0 kDINu+bUAThGJT2zIdAMWNXfu0OQEXu2Se0IXWu54olQ0nXmHBRbo7DS4Y8J9s7UctWy xTp7p2ssd4IrDtEuuduYDt4L21I25IVmByZSYRmAAnCJbKAduulgNU9aKTOB1kqlQaIH 0Y7xlIVb1uQO6/ZkzU/Zz7QKdhZSarC2CnbOw5CT8C8/mDjrQqkSi42EnUlObuSqX1o+ /aiQ== X-Forwarded-Encrypted: i=1; AJvYcCWcIKq6BFR3lld3v0XvV3iKsI/+IAlPFfeLZO2PqGj7N0hsp/U04OgGOCfEx0pev4ZawYKJ56dE7W3YPmA=@vger.kernel.org X-Gm-Message-State: AOJu0YzC69Vd7vlOut7v5jf/5PhlykMG2WHgnNyJ08KIFl4v36DhodGI wxQ6Ny8h7+FEMYHq7vJF61Z7i6dpf15JTiORgwErRHjgsh8Ak0tOcWVJ X-Gm-Gg: AY/fxX7aI9pHADie77xTgpvwgQoecz1/vy92mqqLVUwRkNmIhnVm1I6euP5eMgmXCWP uuDN+TobQdxoZ1bGjf5y4yGfx0P8Cyg6VY6tazlNY0+gXXMTeqYcuL6uhJlzN3iB0WkL3yA7wGt y2zucD1ZO4fXbdluPyVGa7IMMULbzmvNhZg1Knukn6sOOm34zkJI1WHzKHMeATGIeS+DKb1bPV1 zOe8/XaW0+i2movjB7r78tCIAGOBAjhb9inoHoWYynWgucfHDI7Swzpwy8L24yEONh4SIPHDWXi g4nVJdeBo3LL/BYK8s/eziyxZ1UAh9DBeghyxqlcE2IQ+XDnVRCc1yZIKeZYv88bDfrohEtqc1c rkAvTG8k74v7SHUzjOd2txvb7cUnjmhgyQUErcchaC2qPUz3fCwXKWFpmq/hb880ZjHm7r6bIl8 4LqvM7mEvrkn8OS3oUbLs979VlOnTlU9IHX/m3wf6IfSwEkAWvgbDR/toU92g= X-Received: by 2002:a17:902:c408:b0:2a0:9a3b:d2a4 with SMTP id d9443c01a7336-2a700990d72mr85699545ad.10.1768640387316; Sat, 17 Jan 2026 00:59:47 -0800 (PST) Received: from ?IPV6:240e:390:a92:e941:6d59:490b:11d7:ea3? ([240e:390:a92:e941:6d59:490b:11d7:ea3]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2a7193fbf8fsm41231755ad.78.2026.01.17.00.59.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 17 Jan 2026 00:59:47 -0800 (PST) Message-ID: <4df67ba2-cc04-447a-8cbd-cd655b6539c9@gmail.com> Date: Sat, 17 Jan 2026 16:59:42 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 4/8] ext4: propagate flags to convert_initialized_extent() To: Ojaswin Mujoo , linux-ext4@vger.kernel.org, Theodore Ts'o Cc: Ritesh Harjani , Zhang Yi , Jan Kara , libaokun1@huawei.com, linux-kernel@vger.kernel.org References: Content-Language: en-US From: Zhang Yi In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 1/14/2026 10:57 PM, Ojaswin Mujoo wrote: > Currently, ext4_zero_range passes EXT4_EX_NOCACHE flag to avoid caching > extents however this is not respected by convert_initialized_extent(). > Hence, modify it to accept flags from the caller and to pass the flags > on to other extent manipulation functions it calls. This makes > sure the NOCACHE flag is respected throughout the code path. > > Also, we no longer explicitly pass CONVERT_UNWRITTEN as the caller takes > care of this. Account this behavior in Kunit tests as well. > > Signed-off-by: Ojaswin Mujoo It looks good to me. Reviewed-by: Zhang Yi > --- > fs/ext4/extents.c | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c > index a581e9278d48..3d45abfb13cd 100644 > --- a/fs/ext4/extents.c > +++ b/fs/ext4/extents.c > @@ -3844,6 +3844,7 @@ static struct ext4_ext_path * > convert_initialized_extent(handle_t *handle, struct inode *inode, > struct ext4_map_blocks *map, > struct ext4_ext_path *path, > + int flags, > unsigned int *allocated) > { > struct ext4_extent *ex; > @@ -3869,11 +3870,11 @@ convert_initialized_extent(handle_t *handle, struct inode *inode, > > if (ee_block != map->m_lblk || ee_len > map->m_len) { > path = ext4_split_convert_extents(handle, inode, map, path, > - EXT4_GET_BLOCKS_CONVERT_UNWRITTEN, NULL); > + flags, NULL); > if (IS_ERR(path)) > return path; > > - path = ext4_find_extent(inode, map->m_lblk, path, 0); > + path = ext4_find_extent(inode, map->m_lblk, path, flags); > if (IS_ERR(path)) > return path; > depth = ext_depth(inode); > @@ -4263,7 +4264,7 @@ int ext4_ext_map_blocks(handle_t *handle, struct inode *inode, > if ((!ext4_ext_is_unwritten(ex)) && > (flags & EXT4_GET_BLOCKS_CONVERT_UNWRITTEN)) { > path = convert_initialized_extent(handle, > - inode, map, path, &allocated); > + inode, map, path, flags, &allocated); > if (IS_ERR(path)) > err = PTR_ERR(path); > goto out;