Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp542673lqa; Sat, 27 Apr 2024 12:51:08 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWQ83ygNRFDA2rC55hfd0CnGyDTSZEzWBcNwGoOIoy0ABiBEyVQ3LoaPkpvucl/aJ9Lw9mMzx7j2WFFitr4HweKxBOVV4j/xIwnG1cGvg== X-Google-Smtp-Source: AGHT+IGfumBYVmR2s95sfdfkjb8sBCSrIi6DNDO3+miExfMhdryEYZsDqVl3h7J8JB+njzwSd084 X-Received: by 2002:a25:8207:0:b0:de5:d3d1:cbb2 with SMTP id q7-20020a258207000000b00de5d3d1cbb2mr1589046ybk.6.1714247468078; Sat, 27 Apr 2024 12:51:08 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714247468; cv=pass; d=google.com; s=arc-20160816; b=EnizOwQ7UvGCRz4HOqxdV8eYE7BwLbAfnYydY5qyxqAlf+o1K2Wy3caA4n2wkjudEO NTrXw0hjIsofqDuJQdbib+8GUKz/7wFKCWK30PlS/8NK6Q1eplVIM2kS54lveYfkH5c/ Jy5fg65IBfaFLMJVfxidJemHGLzh8r3KmaC2blv2UZe5Sw3QSrbjZ+oblNDxcl4irY9s GUeF2e3W6AYsuE4XRK69BUd7qIgl64YBAj4Wrh+w+DDPE9G3Ugy4hI7vfjUY8t11YzFY ZFesSqFuCGoDCA3b409ScVNLOUyx93NBSOg0ckP6bq9Pp9iaRIAQmqgTJS692wVURC5J 77UA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=Mx+TZI+AhJhXc5nDbpJ3HSmPLnjW2+afsuYEIVpKobg=; fh=dzMbRvqonuKebj9QSlTA33fZUdRS6NFcWYI1U3jX/GY=; b=bQOfp0B0wmu8Tut/nryfOiKX+ohvZErRKm7fbFQS2tdUjF/wiQpsMwV16t97wMXj6J tKZ8x3ZG71qirx5Drp7BL9+0H3NcVlOSHJy3QQQdJiBXlBaRpllqX+xFN/KSflyPzYyF TcTzCpoHbgXHakDdR4RTAYIA/k8+A7ch4Fl5USrMAf5Ekf7LH6K2gULVPzbzfPWUxGzm n+e7V08C5seF/k09nTWBTGG/cZpzCd3Yc2S24eoAqJJQkreRuFHSab97NGy8io2vCMMI NQtilZUV4O8G0SSwSsBM4Ixa75I7VITE/eSOrbwLJaytH4PCARwGJAZAQOHqkIuSRZeT dgbA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=IMy1wOW+; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-161152-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-161152-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id h7-20020ac85e07000000b00439f58aaaadsi11505112qtx.789.2024.04.27.12.51.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 27 Apr 2024 12:51:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-161152-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=IMy1wOW+; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-161152-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-161152-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id B615A1C209BF for ; Sat, 27 Apr 2024 19:51:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 284C14EB33; Sat, 27 Apr 2024 19:51:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="IMy1wOW+" Received: from mail-ua1-f43.google.com (mail-ua1-f43.google.com [209.85.222.43]) (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 E935017C96 for ; Sat, 27 Apr 2024 19:51:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714247462; cv=none; b=ohl5+kv7Gu4+Ysis/52mIdVTHm6MfhFwrBKSy/flMWvYv9qiAazrvSOghquxUH0XImASZHH6DSyjPjOxhXnPWXSIjcgxr1t1dM/kmqPOxx2iq7d84zOJK4UTZ94GNkAxuTCR+Uh/FmVuWjIsFOP4xLostpHy76rqCN9lrCOACKc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714247462; c=relaxed/simple; bh=1vsosJBKgv5N1iIGtdZokDSg5iYoOImnmDW8Lg3/+fs=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=tKEBdtkx97YMBEYxnO9Wo/irwFvP/+gfGP59tK5SmB7y9gePqtosWh46hDosc0OXAwhI9Zs1STQLHTmLACCWfqJEIA/EguEr2sW/Pqreuv//QHlpS6EDWRSyM7Kls7lEZfMzz/vg2//Ju7KqhUUaswmcW278+GZgO9hP3seCQ8k= 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=IMy1wOW+; arc=none smtp.client-ip=209.85.222.43 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 Received: by mail-ua1-f43.google.com with SMTP id a1e0cc1a2514c-7f06c86bf87so101278241.3 for ; Sat, 27 Apr 2024 12:51:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714247460; x=1714852260; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Mx+TZI+AhJhXc5nDbpJ3HSmPLnjW2+afsuYEIVpKobg=; b=IMy1wOW+MKl7zwpL0YGQ/x1bVvxY5WDDrl3yPAVG7rCuSEBOErtMhVCnLsobkEcPvR u0H67wUpELphW4RrUqvoFKHUrPbVS5BC6k2O3bfvBY31TCdrphDPL0HGtt8CfpKcOMJ/ 75AeguncGQ6x/CGdL7045G0y2ge52FcbnPY2lIy1mFEdllryijdGpeWPv50rJUTXx9NW ATvz1Tp4+SzxePX9KzbMhnJpe3/oL4SlViYKPcG+i8NEX/1lkNVs7scaF9xqySUloVFC 1IJppZTCVcgjIZ4YGjNg6Vzm9Rwso06Wm4rO0Kf5OGGdQ+mctM+HH1pDM4Gsclytzpqx 7oTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714247460; x=1714852260; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Mx+TZI+AhJhXc5nDbpJ3HSmPLnjW2+afsuYEIVpKobg=; b=BpurMf5G1+BxhtNwV219xqo5MwLK3wyjPZbVpwXisHR7qVAEaOKlEuEOKQP61DZ/t8 LQnNzAlrFhO9hDHPif3FCX//lnGwSAjSuuBIC13Ofl2FvSM5Rzdc0FpcK8IGuK4d63pi i4/WRZpl8HgaqYgEdbbl1hbXbjIV4I5vyDn38+jp0z3ZHMUbdMqX0rBTpzi0wOwENPSd X0G+G+WDxNXmJSj67c2zM5AtP+I8iYFL4IVZ4s4zqXJE1nqShBrPi9iA2FlZQzJX14Mu IpMPwGzRoG2cSi9yUU9CKefAzWd49O43IgbL5rQ2VDve8nUjNtSCKkssVrNMKZSteFb9 UIWQ== X-Forwarded-Encrypted: i=1; AJvYcCVEkEwi6PC5zOlIF5LiYRxqZ2lNOkBjf04EGtwHRNpUtV37YKt/fAjiDAReCIqx6lckwPIYv0miyVKpW/s9ueYJFaoD3ledrv+h3yfr X-Gm-Message-State: AOJu0YyzONZFhO5H7Os2hB15e+T4Jli4U6wQN2WQwTVIUcnh9MI7//Q0 H7U9NmYSVhthtnke0RlNt60RVGXWSs4OIR4F29giqGG7/VnuPJZeCQ/FeY6So/Bvy3ftnr9vqDU F/mKDfBI+Ep7JZQLnJwtJohqjWs0= X-Received: by 2002:a67:e8d1:0:b0:47b:fe0b:a92e with SMTP id y17-20020a67e8d1000000b0047bfe0ba92emr6582019vsn.16.1714247459742; Sat, 27 Apr 2024 12:50:59 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240426103528.406063-1-chao@kernel.org> In-Reply-To: From: Daeho Jeong Date: Sat, 27 Apr 2024 12:50:48 -0700 Message-ID: Subject: Re: [PATCH] f2fs: zone: fix to don't trigger OPU on pinfile for direct IO To: Chao Yu Cc: jaegeuk@kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Apr 26, 2024 at 6:49=E2=80=AFPM Chao Yu wrote: > > On 2024/4/26 22:14, Daeho Jeong wrote: > > On Fri, Apr 26, 2024 at 3:35=E2=80=AFAM Chao Yu wrote= : > >> > >> Otherwise, it breaks pinfile's sematics. > >> > >> Cc: Daeho Jeong > >> Signed-off-by: Chao Yu > >> --- > >> fs/f2fs/data.c | 3 ++- > >> 1 file changed, 2 insertions(+), 1 deletion(-) > >> > >> diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c > >> index bee1e45f76b8..e29000d83d52 100644 > >> --- a/fs/f2fs/data.c > >> +++ b/fs/f2fs/data.c > >> @@ -1596,7 +1596,8 @@ int f2fs_map_blocks(struct inode *inode, struct = f2fs_map_blocks *map, int flag) > >> > >> /* use out-place-update for direct IO under LFS mode */ > >> if (map->m_may_create && > >> - (is_hole || (f2fs_lfs_mode(sbi) && flag =3D=3D F2FS_GET_BL= OCK_DIO))) { > >> + (is_hole || (flag =3D=3D F2FS_GET_BLOCK_DIO && (f2fs_lfs_m= ode(sbi) && > >> + (!f2fs_sb_has_blkzoned(sbi) || !f2fs_is_pinned_file(inode)= ))))) { > >> if (unlikely(f2fs_cp_error(sbi))) { > >> err =3D -EIO; > >> goto sync_out; > >> -- > >> 2.40.1 > > > > So, we block overwrite io for the pinfile here. > > I guess you mean we blocked append write for pinfile, right? > > > > > static ssize_t f2fs_file_write_iter(struct kiocb *iocb, struct iov_iter= *from) > > > > { > > ... > > if (f2fs_is_pinned_file(inode) && > > !f2fs_overwrite_io(inode, pos, count)) { > > If !f2fs_overwrite_io() is true, it means it may trigger append write on > pinfile? Yes, I missed it. Thanks~ > > Thanks, > > > ret =3D -EIO; > > goto out_unlock; > > } > > > > > >>