From patchwork Tue May 28 12:18:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?6LCi6Ie06YKmIChYSUUgWmhpYmFuZyk=?= X-Patchwork-Id: 1940461 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=wftuXKyY; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VpWp60Ddfz20Q3 for ; Tue, 28 May 2024 22:21:17 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type:List-Help: Reply-To:List-Archive:List-Unsubscribe:List-Subscribe:From:List-Post:List-Id: Message-ID:MIME-Version:Date:Subject:To:Cc:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=vkdgC1+ybb5gtASxfcATOAh3HS6S3i8Zu1CtW72h688=; b=wftuXKyYCuE6bJH91zK2AVU/pU e9Ia7jd4/vZzWgug7czSfMIkZja0vgNk3KkfgKBMw47IzN83Erf/WFu+ykSGBJBuNbVR1rrZrEKLI qlyvLj7QP41xz0b8WbK4f31eQJUTaEbp1q9N33GSVgcOKTJXVLPNrZw97rr0WiPvFB5iqXOx+IDlB d2dflmi5HUozmu8tMC+HMpeZc9s2TDa3C/uupvKLIgNTmJlDbzKzpnCMGf2WHOK+kXsP1YQ4cnxqZ ZoLKoebKOwYjG7Kb8T8fdlW+tbIJWC+74WcgbW6PakNAcIlIOvaX/Uw+lmdomgHehgTmKJyNMLLgI ECFc3EqA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sBvny-00000000XtK-2HL6; Tue, 28 May 2024 12:19:50 +0000 To: openwrt-devel@lists.openwrt.org Subject: [PATCH fstools] libfstools: partname: drop parent_dev Date: Tue, 28 May 2024 12:18:02 +0000 MIME-Version: 1.0 Message-ID: List-Id: OpenWrt Development List List-Post: X-Patchwork-Original-From: =?utf-8?b?6LCi6Ie06YKmIChYSUUgWmhpYmFuZykgdmlhIG9wZW53cnQtZGV2ZWw=?= From: =?utf-8?b?6LCi6Ie06YKmIChYSUUgWmhpYmFuZyk=?= Precedence: list X-Mailman-Version: 2.1.34 X-BeenThere: openwrt-devel@lists.openwrt.org List-Subscribe: , List-Unsubscribe: , List-Archive: Reply-To: =?utf-8?b?6LCi6Ie06YKmIChYSUUgWmhpYmFuZyk=?= List-Help: Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org The sender domain has a DMARC Reject/Quarantine policy which disallows sending mailing list messages using the original "From" header. To mitigate this problem, the original message has been wrapped automatically by the mailing list software. Using parent_dev will cause use_f2fs() to make wrong detection. Signed-off-by: 谢致邦 (XIE Zhibang) --- libfstools/partname.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/libfstools/partname.c b/libfstools/partname.c index 9f2347a..a950efe 100644 --- a/libfstools/partname.c +++ b/libfstools/partname.c @@ -15,11 +15,6 @@ struct partname_volume { char devpathstr[16]; struct devpath devpath; } dev; - - union { - char devpathstr[16]; - struct devpath devpath; - } parent_dev; }; static struct driver partname_driver; @@ -56,7 +51,7 @@ static int partname_volume_init(struct volume *v) v->size = volsize << 9; /* size is returned in sectors of 512 bytes */ v->blk = p->dev.devpathstr; - return block_volume_format(v, 0, p->parent_dev.devpathstr); + return block_volume_format(v, 0, p->dev.devpathstr); } /* adapted from procd/utils.c -> should go to libubox */ @@ -182,14 +177,6 @@ static struct volume *partname_volume_find(char *name) strncpy(p->dev.devpath.device, devname, sizeof(p->dev.devpath.device) - 1); p->dev.devpath.device[sizeof(p->dev.devpath.device)-1] = '\0'; - memcpy(p->parent_dev.devpath.prefix, "/dev/", sizeof(p->parent_dev.devpath.prefix)); - if (rootdev) - strncpy(p->parent_dev.devpath.device, rootdev, sizeof(p->parent_dev.devpath.device) - 1); - else - strncpy(p->parent_dev.devpath.device, rootdevname(devname), sizeof(p->parent_dev.devpath.device) - 1); - - p->parent_dev.devpath.device[sizeof(p->parent_dev.devpath.device)-1] = '\0'; - p->v.drv = &partname_driver; p->v.blk = p->dev.devpathstr; p->v.name = name;