From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=115.124.30.98 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796374303; b=ZGd2hE4DdHsWghdM6E7s3UgNZB7/xnFDpgFimJsUEhdygvfTWU3PfP7R9HmCRTBvEA3Z pYemf8aOiS/Zb3ZTIT5ZahLpo4/BqyOkkZ2W9DQo3/XpOWoot/8X2eNEuhVZgfYYvYgDH UP7zrxkIhIsJe2CYgtTjnJVzVKbPrhqcXsSy+eusLGIaLgx7yy/wQALfXjwY4h45mA9x2 BEHczzSdjoWaer+YpniaPSmptnBM8o/DprfVcRvtOnbV1xOQ2+N6dkFDr1BGYLF5hVeFr 6SuXzvZeVdaEvM4gtsj8yhbSUGNz0/XwRwurakTzXxOLFpIo86Ou8sdwHDueVLED+ug== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796374303; h=DMARC-Filter:DKIM-Signature:X-Alimail-AntiSpam:Received:Message-ID: Date:MIME-Version:User-Agent:Subject:To:Cc:References:From: In-Reply-To:Content-Type:Content-Transfer-Encoding; bh=oRXXvQHZM/lEJEN3FCv7cWrPGY0fCmWZAq/8RAhylAE=; b=P6gmOTodBPOC5uxvYuYn1tQQwG87+z9Bi7IPBErLKgYSbb6zkrLCYRf1Dh+0dXEdFVC6 x1Dr0OyOqpZONg+Rb9RKqsgKSpY301ixtCcQb0FfBR2qY+Fokfxx9+0PqYdTqhJL3Gq0m tSk6QmrJnYeNiqmS4u+1YNEvl71Dvd+nN+PzDSiWKbXlrrlrRdjQKBgHEiToaVXd1DFF4 7KwYp/OY/FWLMojVdYywacv6iD7+ZjdMiDR//Zf3Qg8Mv0SYB+gr//hWxT2FqGre9X8Hb br6BiAl9rzi53ZBAMqSg1hHd2JRp4PFgo2z1mTaYcvrrXy4/97SM0YTRb0SbCfwFoqw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass header.d=linux.alibaba.com header.i=@linux.alibaba.com header.a=rsa-sha256 header.s=default header.b=UX2J70aX; arc=none smtp.remote-ip=115.124.30.98 Received: from out30-98.freemail.mail.aliyun.com (out30-98.freemail.mail.aliyun.com [115.124.30.98]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5B107606A322 for ; Fri, 4 Dec 2026 08:51:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 5B107606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.a=rsa-sha256 header.s=default header.b=UX2J70aX DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1796374299; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type; bh=oRXXvQHZM/lEJEN3FCv7cWrPGY0fCmWZAq/8RAhylAE=; b=UX2J70aXEWpYcyeDp24NtKbYtHAcCFvwf2xgaZY1/OtJVEX591UHWa2RuZpnVw0FyNFyl5UiGqIT58oW4D6q0s87tUqf5enQXQM4IDKaYtQDqJ1rsqCydHLULyJwerOZbs229g20h5bgrMelYVvOZlTEapbNbdQ5Jqq/64hv+qg= X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R331e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam033065142238;MF=baolin.wang@linux.alibaba.com;NM=1;PH=DS;RN=7;SR=0;TI=SMTPD_---0XGGk3Jx_1796374298; Received: from 30.74.144.139(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0XGGk3Jx_1796374298 cluster:ay36) by smtp.aliyun-inc.com; Fri, 04 Dec 2026 16:51:38 +0800 Message-ID: Date: Fri, 4 Dec 2026 16:51:37 +0800 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] tmpfs: escape the space in the mpol mount option To: Yifan Feng , Hugh Dickins , David Hildenbrand , Andrew Morton Cc: Gregory Price , linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20261202001843.71256-1-evanfengff@gmail.com> From: Baolin Wang In-Reply-To: <20261202001843.71256-1-evanfengff@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 12/2/26 8:18 AM, Yifan Feng wrote: > The policy names "weighted interleave" and "prefer (many)" contain a > space, and shmem_show_mpol() prints the name as it is. Readers of > /proc/mounts take the space as the end of the options field, so > mount(8) reads back mpol=prefer and an unrelated remount replaces the > policy: > > # mount -t tmpfs -o 'mpol=prefer (many):0-1' none /mnt > # grep /mnt /proc/mounts > none /mnt tmpfs rw,relatime,inode64,mpol=prefer (many):0-1 0 0 > # mount -o remount,size=128M /mnt > # grep /mnt /proc/mounts > none /mnt tmpfs rw,relatime,size=131072k,inode64,mpol=local 0 0 > > With "weighted interleave" the same remount fails with EINVAL. > > Escape the value like the other fields of the line, so that the space > is printed as \040. The mount above is then shown as > > none /mnt tmpfs rw,relatime,inode64,mpol=prefer\040(many):0-1 0 0 > > and keeps its policy over the remount. > > Fixes: b27abaccf8e8 ("mm/mempolicy: add MPOL_PREFERRED_MANY for multiple preferred nodes") > Signed-off-by: Yifan Feng > --- LGTM. Reviewed-by: Baolin Wang