Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3457235pxb; Sun, 31 Jan 2021 17:01:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJxGqZhFM3XiSOoHyiyP2knmtzCJw2YFC2BZjsc+Pg9Tz2yo+/J+JSC8TlF11QlwZEwrqRSP X-Received: by 2002:a17:906:40d2:: with SMTP id a18mr5242325ejk.82.1612141274112; Sun, 31 Jan 2021 17:01:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612141274; cv=none; d=google.com; s=arc-20160816; b=dEy0hjny7WsxIyVXshpryOFs4Sfm6fCjCJB9ccPICAvam385sOg/wQHAA54IT0AIzI /2MQ/tEQSvY5Ih9IX6DMiLgx7C2Gj87ifvqZAQgaOMs6x5bNBB7vitDXCX1ooS2V2RPO FFIk8b9Ez7IoOJ5qykgF6kOl3XKGaRi3LZw5ahRX3/rwpDiAYfM+A8oLPMc5gf77smio 6i6Gkn67UXncNmUQD4eG6AiKCMO/QiUjgB+uBaRoy05H16SvvaVD29cI/D5nS2U3qA4R gtxXeqw9mv4ZNAmojGAc+UKTGX2lpTlBrSzjnSX1gdtOdnpXuPWhMQs1FvxDLwDWiAFH 3q9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=/0gRcVEeV6nGqliN47YBX62tljuHs3/rhZ5XnTs5IdQ=; b=teH2gYk7rCrf1sM3gKHX3z4N6+N9GF2uoA1qmY4S67PdgzjPeIOVVxCULu6Dxg0CJr DDeyLv6ae9poL1Jj1eBe9vxW5rF/4fQrSlRwvdaZWkqO4QCgSZyZvZgkM7gfssr7Pa+O 3+TldPuK9fIK91C3BgTQhN4wNcmDjpvR4gXbtLYNSnX1UpJr+YOdxf5aU36nN30BCuME 0/Ea5Ocm9DogPK1t8tDNULnTuzhbbGt2T8/JW9kDB3jnxe26EuG6NmCjVbRoAoM4Fhv4 P6XZoRN733oPEa24YxxkM4QiEsBuh6cNXVRn2U0Rqoy3tSYnASO4bh9BubeZJ+P9SZXp kbwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=vPtgppTi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qp1si9119974ejb.183.2021.01.31.17.00.48; Sun, 31 Jan 2021 17:01:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=vPtgppTi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230186AbhBAA6i (ORCPT + 99 others); Sun, 31 Jan 2021 19:58:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52414 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229535AbhBAA6h (ORCPT ); Sun, 31 Jan 2021 19:58:37 -0500 Received: from mail-pg1-x52f.google.com (mail-pg1-x52f.google.com [IPv6:2607:f8b0:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5A7E4C061573 for ; Sun, 31 Jan 2021 16:57:57 -0800 (PST) Received: by mail-pg1-x52f.google.com with SMTP id t25so10913206pga.2 for ; Sun, 31 Jan 2021 16:57:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=/0gRcVEeV6nGqliN47YBX62tljuHs3/rhZ5XnTs5IdQ=; b=vPtgppTigwEDjlMnvlfXOBT+rhGArs6+qUQ1QklRcYLpqr+chl/rod3Fgbx6LBmOiF kTyNnXkOHSPPt4aLOww4SNI9Rff59x8Jy9Cba0rqBvstfl2kIoqg70RjmHVLRSol7dMY hjIOGQ8noN02/j7L6HtWvdDArrKvVFWpzkDsHD9CqpAwF/fdVxrqXA0UIEdBTRHPrJOJ 0xR145ZXXfgcQLS5gFLJK7Go6D/bnxx0vwXyXF/7+aKusuigOcvW8N1Xtep7oCz2ooIS HpHmlDJEQBzU02azajmbeWsG4+O2XFkra8t2tjKDLT3b5TOsYzfiCVBsR2qzAy94yNRr PVVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=/0gRcVEeV6nGqliN47YBX62tljuHs3/rhZ5XnTs5IdQ=; b=NIocsPkEHgX4EOB5QqG4ybQQ/SWOKMo16zJHwmbo1u5R2iNoOeIiEhxI4gHlWfL4JS ZYPOMss9NQbJFoU+hqfivGBtlmKOHo38GvafwnAKCCeOcKeAy9YeKMd1D6xJ68cSrBD+ yRE7bvzmY5red54u/aV6suFyRBrBHWftSjjTHdTE6zT7li5POEHi80MZdZQZQvFA0cI8 rJYvGJf/xsPeYligO9oKdAdvTLhAwk3it0voNNT54JyP87fnXkv+yVPVTGiq20mao9ZJ nUHOOvI8lZck7UqR73si36xefiRrARxaVMM6S3gleC9cxc6mQ2NzxFf4/qQOv5DsMAc6 PkBw== X-Gm-Message-State: AOAM532O6+OkzSfEMp33OqdsES84nWGn4/6AYL8DP/cYZbQHAXqkcvBP /0U6c47s+p3JSfwbMva0hfI0nKY9Li4= X-Received: by 2002:a65:6547:: with SMTP id a7mr14384815pgw.50.1612141076531; Sun, 31 Jan 2021 16:57:56 -0800 (PST) Received: from daehojeong1.seo.corp.google.com ([2401:fa00:d:11:3d90:5212:5281:e85d]) by smtp.gmail.com with ESMTPSA id 24sm12719797pgs.90.2021.01.31.16.57.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 31 Jan 2021 16:57:55 -0800 (PST) From: Daeho Jeong To: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, kernel-team@android.com Cc: Daeho Jeong Subject: [PATCH] f2fs: prevent setting ioprio of thread not in merge mode Date: Mon, 1 Feb 2021 09:57:49 +0900 Message-Id: <20210201005749.2980575-1-daeho43@gmail.com> X-Mailer: git-send-email 2.30.0.365.g02bc693789-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Daeho Jeong It causes a crash to change the ioprio of checkpoint thread not in checkpoint=merge. I fixed that to prevent setting the ioprio of the thread when checkpoint=merge is not enabled. Signed-off-by: Daeho Jeong --- fs/f2fs/sysfs.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/fs/f2fs/sysfs.c b/fs/f2fs/sysfs.c index 100608bcd517..e38a7f6921dd 100644 --- a/fs/f2fs/sysfs.c +++ b/fs/f2fs/sysfs.c @@ -357,8 +357,12 @@ static ssize_t __sbi_store(struct f2fs_attr *a, return -EINVAL; cprc->ckpt_thread_ioprio = IOPRIO_PRIO_VALUE(class, data); - ret = set_task_ioprio(cprc->f2fs_issue_ckpt, - cprc->ckpt_thread_ioprio); + if (test_opt(sbi, MERGE_CHECKPOINT)) { + ret = set_task_ioprio(cprc->f2fs_issue_ckpt, + cprc->ckpt_thread_ioprio); + if (ret) + return ret; + } return count; } -- 2.30.0.365.g02bc693789-goog