Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1067598rwi; Wed, 19 Oct 2022 06:24:46 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6LDbpASXD0qqWbbohDB3Q27AyR39Q9zJF5n1vY46v5E/DV+mkCLvNgUjsZUmYNEc66nEiG X-Received: by 2002:a17:906:7304:b0:6ff:a76:5b09 with SMTP id di4-20020a170906730400b006ff0a765b09mr6598564ejc.193.1666185886513; Wed, 19 Oct 2022 06:24:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666185886; cv=none; d=google.com; s=arc-20160816; b=xeHWjKmBmR/v42xxOSjEzk3p6fKoRNw+hK8w2tu1b38TuTwWSMtbUp5qlrknBMET4o EatALH7fqfd4czxdx/8HrTxeLDO90TvtwEbOODgjjHAJ36DtUlGivlVtiG1UcFxgo5Hi M3vDyYsORxLWzlRtwFws1kgnL8trbl+jyQ15UVhwjF+Kt3I0BtMKAo5T87Ck8NUYzevP DGSetqK2NWDjfDjzcVfTq4Oe/nFba9W0HCGY1Xi00slBV88sAbE3Xa6ZomMeclddrkh1 R1OsWiNbkAM7NTXNWIEDyzjlYBgxl6GjwhopjLk3rrevIt5gOQm9TlNjzl6GURWzeEhW rMNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:reply-to:message-id:subject:to:from:date:dkim-signature :dkim-signature; bh=DIVmI7hDWtRjXOIuomwqF0FtvW97AwrOu0bOOYmNl/k=; b=L18NgYp4o4iQsfA8tSaR7lcaENKu3n5zWobCUoA2UpvKFLzdCDcnMTnjnKz4wjIpRb f5aXscDX5LA7F6tBcH3GNMy6eekEjQfi/5VQ/PY3oGFTh//dJ7QfcckJsM1ZxKwRF+Y0 scOvuvgXIx3FYIpbSeYG4deWr8GuQOhAE/g5fogEsF6pFS5UqoL6YygWDxJbZQUwlD2s BsJPMnEtskoBCN4qJruinzkeWo4VoZV1Dayx/kbB3cQtcvkoYE4HiOboAY1FtA5B81Lb SBwoM4OnwZz832NFfpR2sd0qWOYiwQRzYgJVuBlKoqRdNfHtzyb/ntLpKAe/ubz3NPvz Vwng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=I2FxgsrV; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=C4SXbJ1Z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dm12-20020a170907948c00b0078a802cce5dsi1801455ejc.592.2022.10.19.06.24.20; Wed, 19 Oct 2022 06:24:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=I2FxgsrV; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=C4SXbJ1Z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233231AbiJSMuj (ORCPT + 99 others); Wed, 19 Oct 2022 08:50:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58682 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231776AbiJSMt2 (ORCPT ); Wed, 19 Oct 2022 08:49:28 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA6671C4921 for ; Wed, 19 Oct 2022 05:32:19 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id C8B0D1FD10; Wed, 19 Oct 2022 12:31:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1666182680; h=from:from:reply-to:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=DIVmI7hDWtRjXOIuomwqF0FtvW97AwrOu0bOOYmNl/k=; b=I2FxgsrVZxgTI3SNhCtv1KZIq3p15PWGTxC/zJehbKBREgGPOhjflvNBwcyNe6v3C7f08u kfN2gF1iE/M+VJTqg4QUXofOu0zAmO5VqBppmGFZyj3hCMm8E9g2JCBd4WT4iz8aIZ03E1 SVlJDCe9ESlOMUUUGoCDhpslBtVs8dk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1666182680; h=from:from:reply-to:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=DIVmI7hDWtRjXOIuomwqF0FtvW97AwrOu0bOOYmNl/k=; b=C4SXbJ1ZHQnipSqi/Klx34IL6bKB9gSBm3wWxuzBkPDLExTCr7MOJFC3JATq+4/pp//Tnd X2RMp1gFs/FqzmDQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 8F66213A36; Wed, 19 Oct 2022 12:31:20 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id DaiCIRjuT2MjbAAAMHmgww (envelope-from ); Wed, 19 Oct 2022 12:31:20 +0000 Date: Wed, 19 Oct 2022 14:31:18 +0200 From: Petr Vorel To: Torsten Hilbrich , linux-kernel@vger.kernel.org, Andrew Morton , Kroah-Hartman Subject: Re: v6.1-rc1: Regression in notification of sethostname changes Message-ID: Reply-To: Petr Vorel References: <0c2b92a6-0f25-9538-178f-eee3b06da23f@secunet.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_SOFTFAIL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > Hi Torsten, > > Hello Petr, > > your commit > > commit bfca3dd3d0680fc2fc7f659a152234afbac26e4d > > Author: Petr Vorel > > Date: Thu Sep 1 21:44:03 2022 +0200 > > kernel/utsname_sysctl.c: print kernel arch > > Print the machine hardware name (UTS_MACHINE) in /proc/sys/kernel/arch. > > This helps people who debug kernel with initramfs with minimal environment > > (i.e. without coreutils or even busybox) or allow to open sysfs file > > instead of run 'uname -m' in high level languages. > > broke the notification mechanism between the sethostname syscall and the pollers of /proc/sys/kernel/hostname. > > The table uts_kern_table is addressed within uts_proc_notify by the enum value, however no new enum value was added in "enum uts_proc". > > I noticed the problem when journald-systemd failed to detect hostname changes made with the sethostname syscall (as used by the hostname tool). > > When setting the hostname through /proc/sys/kernel/hostname the poll notification was working. > Thanks a lot for your report, working on a fix! > Andrew, Greg, sorry for a regression. Hi Torsten, could you please post exact steps to reproduce the problem. Although the required fix to add new enum into enum uts_proc is trivial, I was not able to reproduce the problem with 6.1.0-rc1 (actually 6.1.0-rc1-4.g1d716d8-default which contains few extra patches). # hostname; hostnamectl hostname; cat /proc/sys/kernel/hostname opensuse-tumbleweed.20221001 opensuse-tumbleweed.20221001 opensuse-tumbleweed.20221001 # hostnamectl set-hostname foo; echo $? 0 # hostname; hostnamectl hostname; cat /proc/sys/kernel/hostname foo foo foo # hostname bar; echo $? 0 # hostname; hostnamectl hostname; cat /proc/sys/kernel/hostname bar bar bar # echo "baz" > /proc/sys/kernel/hostname # hostname; hostnamectl hostname; cat /proc/sys/kernel/hostname baz baz baz # hostnamectl set-hostname foo; reboot After reboot it's 'foo'. What am I missing? BTW I originally tested the feature only on dracut initramfs (with rapido [1]), which obviously bypass systemd. For a fix I'm creating rpm package (binrpm-pkg). Kind regards, Petr [1] https://github.com/rapido-linux/rapido > Kind regards, > Petr > > Torsten