Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp730514rdb; Thu, 22 Feb 2024 19:21:46 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCW7TEnJDDVLRdWWzZ7xhZN4W98Vn6kMKLL3MBO5datuU27mOtEMCp+WirecpUqa8q/JNg9WIOL3B844AI80NBykfvHGBS/Qw04v+jcwWQ== X-Google-Smtp-Source: AGHT+IE4YdGGWjFlg4T2HxjjgdegpEN3WmNCK74FdSp6ppMsmlxElpzJUrvkorrDTmY2HMFt0M6S X-Received: by 2002:ac8:4e55:0:b0:42d:afd3:7b69 with SMTP id e21-20020ac84e55000000b0042dafd37b69mr1268394qtw.63.1708658506322; Thu, 22 Feb 2024 19:21:46 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708658506; cv=pass; d=google.com; s=arc-20160816; b=hmigIXGPH97SfVDSnbEzRQuiBVTcHVsfzO9Uikx/ANa69lcv5fYjv4N3t/P8/QRBSg 8B8X7oyKfXuRHhtYCNzHQPgkioENXsZSILeOTHzya+CkotO1jJdLKvPx9dEBcXlZu61J q3BJtzwW9T0u90mI3LcvJ5mdYhYxIA9lvOuOUzW8abTsYuqQbSGB/eznKCRVioy65FfC xuhd8gDYhn7KesQG7208Y9znq04wPZPe1Ooh63y5fYC5mqNqnwhFeozzJSx7jFd81pg3 jQjYummP3PWFZA/N+JTY2cWAlf2OwDknbXoffcDhWh0nCCoBeAaBxJ6FQtpaTpTILnRI bNEQ== 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=Gz9/y1+Xczqmn0vzWbn4vSoN0rultOqiJeV+pU2vDP8=; fh=hXDjlGZ64oWRoydioLcNCAusA8f5W3IFFPYd+uxh0B4=; b=vBy3+OXO3eO0pzZsBPyjD7bdqj1+qVEn6VHFt0YNihIIN07+oDwSWoTVJjIwj2Qwv2 xBWXAV602a71Nr/PKiQSTZjVzgBFR2GVKaEUDBqOk5hCqbEeT1nubjiNC4448pN72sp8 g9Eh+/fJm4kDI/SukKnYyw6o7qwMAs1qxR7racYvgvr+Cl+7MVvloYo22rAH/mkEpWBE Cbptm9SdXFkkhGoyPr6+QNW5KUV8xrmS/Yjycm/rrXkwW11NAHKMj/J5ien9eR1KeZmM MF8c8WGmcx5/U4ny/RD5pUsfNDdEihnCrO+fhHCUzRydVotJzQxFYS/ETuAfH7IYFjGQ BHOA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@smartx-com.20230601.gappssmtp.com header.s=20230601 header.b=mlsOYNF4; arc=pass (i=1 dkim=pass dkdomain=smartx-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-77711-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77711-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id h12-20020ac8548c000000b0042c4a985c46si14015305qtq.35.2024.02.22.19.21.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 19:21:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-77711-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=@smartx-com.20230601.gappssmtp.com header.s=20230601 header.b=mlsOYNF4; arc=pass (i=1 dkim=pass dkdomain=smartx-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-77711-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77711-linux.lists.archive=gmail.com@vger.kernel.org" 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 E85FD1C225B9 for ; Fri, 23 Feb 2024 03:21:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DFCEBDDA6; Fri, 23 Feb 2024 03:20:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=smartx-com.20230601.gappssmtp.com header.i=@smartx-com.20230601.gappssmtp.com header.b="mlsOYNF4" Received: from mail-lj1-f175.google.com (mail-lj1-f175.google.com [209.85.208.175]) (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 012DAC8DE for ; Fri, 23 Feb 2024 03:20:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.175 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708658456; cv=none; b=DP/bmll5QBp3wew/wzhJzQI/xnG1mnuwOThJPISS+V9BX+pjXwhSpcvq4yCYH5wihApceZhGrit4jZuA8uuuxcgI/tZsmNsuPiri9mTLoMiItWgbxA4eeQPrQ9uYg8eXzeUjac1pKqqHHv/1UHK5dqktLgromz/kJZmjAYwo2r0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708658456; c=relaxed/simple; bh=1jVuDccX6c53Z5TPHBrUqUB5hgIDnadIovqzOPyZsRI=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=pcbIWQTjCVOhJbgqRyw07goi0jj7au00pvm+5Dcdh7QsFdxGPDtt8QvS7YsyRu8jf4SqFArqDoaVQenEio4CZCaSSd8L0AJa71Cmp7717091XJUA9TkMK6/nY4AE9fr09org3NrxiT0iSpuizobnGjnkFsdZniogXS469uWfx8U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=smartx.com; spf=none smtp.mailfrom=smartx.com; dkim=pass (2048-bit key) header.d=smartx-com.20230601.gappssmtp.com header.i=@smartx-com.20230601.gappssmtp.com header.b=mlsOYNF4; arc=none smtp.client-ip=209.85.208.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=smartx.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=smartx.com Received: by mail-lj1-f175.google.com with SMTP id 38308e7fff4ca-2d22fa5c822so5858961fa.2 for ; Thu, 22 Feb 2024 19:20:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smartx-com.20230601.gappssmtp.com; s=20230601; t=1708658452; x=1709263252; 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=Gz9/y1+Xczqmn0vzWbn4vSoN0rultOqiJeV+pU2vDP8=; b=mlsOYNF4ZX9GlCAQV+O1mwDa7JWjeWZxKVwaVUwiScj+wS+ir0XZfNW8oU0nWxfMm8 lsnPSOUjQX56ci+T7k6dNdD9irGm9wrMb15zvDfABroydLK8WrQK9+N/qgPdaGMAHvcY XYwtk9Hm1Py3dTmPYD8QxREZqpe7X7M13vEkCb8ywOiePaCrxePmkyCFD74/Ye0wdAdo 6H9iqBRnXLBJcw05pd5mK7davxdttRn0O4PIa5g0wEUbjHzQeQ9WleVR3EHR4aZKolrm qGdzy2c4ElD3IMz1yrlIbzQ4sxM5OH3KXwMvaFz0Fn9feLHMvd2oiyYoqdTxqU9KlKW0 1ydg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708658452; x=1709263252; 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=Gz9/y1+Xczqmn0vzWbn4vSoN0rultOqiJeV+pU2vDP8=; b=Wqyi1+yYncASbswjJWz8iw1AlBEy1NASaWp+9LIs+sucUHv4uzlwSAG3Gz15G6mICw nCsvqlyXUrEV9PYfLfaKkuDXugy0m/Qy89K49T3svvSJGW9gSHth3otEo4sGpsZznbMA WfNcMuukq2v4uaRQ5X+GkJmxQyJfY9buIeuLk068NU4WA54g2LItra2f2d8DbLyYZ8ey cIqiLQoFASb6i4oW70fDHYlyuCYzwkcjPcZVZuPfkuij/e+sH3zN30izlalT0lGzMYwU 8Xpv5xdn6jV8OZJpwFC9p7PnEMBMeekvsKKvNKC3IQRlntm6xpuvifptMNVlNpDQBPsf zZKQ== X-Forwarded-Encrypted: i=1; AJvYcCVKc4yJBZh/CMwFpAn7XDDgNVobzKrFul/hvGDQ8Ef4FmRC5ukQEbMvzBjKQinVk/B31FBQCClhSv6jzDxU549mouekxTux9Jec98Jy X-Gm-Message-State: AOJu0Yx1PSsnXbOEibFhNU9SMY8hXaWN/7eewKT66IGUe8yPtvgpeAdh G//UHAH9tZkr6YVVRi4+FD/wcM6mewhhb+jeFBtSq1u8X3uBdCAYbhovINIKZ9ULX7cgAgwqDk0 14bTjQbx6sKv5tjqiPbLcP8a/BbIkP/JWgBeBiA== X-Received: by 2002:a2e:9602:0:b0:2d2:4589:b7ba with SMTP id v2-20020a2e9602000000b002d24589b7bamr421076ljh.51.1708658451177; Thu, 22 Feb 2024 19:20:51 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <77a58302766cb6c8fac45682ede63569df80cd5d.camel@hammerspace.com> <1179779e2f74e3e5cb2be30cf89e6362aaab706d.camel@kernel.org> In-Reply-To: <1179779e2f74e3e5cb2be30cf89e6362aaab706d.camel@kernel.org> From: Zhitao Li Date: Fri, 23 Feb 2024 11:20:37 +0800 Message-ID: Subject: Re: PROBLEM: NFS client IO fails with ERESTARTSYS when another mount point with the same export is unmounted with force [NFS] [SUNRPC] To: Jeff Layton Cc: Trond Myklebust , "chuck.lever@oracle.com" , "tom@talpey.com" , "anna@kernel.org" , "Dai.Ngo@oracle.com" , "neilb@suse.de" , "kolga@netapp.com" , "huangping@smartx.com" , "linux-nfs@vger.kernel.org" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thanks for Jeff's reply. I did see ERESTARTSYS in userland. As described in the above "Reproduction" chapter, "dd" fails with "dd: error writing '/mnt/test1/1G': Unknown error 512". After strace "dd", it turns out that syscall WRITE fails with: write(1, "4\303\31\211\316\237\333\r-\275g\370\233\374X\277\374Tb\202\24\36= 5\220\320\16\27o3\331q\344\364"..., 1048576) =3D ? ERESTARTSYS (To be restarted if SA_RESTART is set) In fact, other syscalls related to file systems can also fail with ERESTARTSYS in our cases, for example: mount, open, read, write and so on. Maybe the reason is that on forced unmount, rpc_killall_tasks() in net/sunrpc/clnt.c will set all inflight IO with ERESTARTSYS, while no signal gets involved. So ERESTARTSYS is not handled before entering userspace. Best regards, Zhitao Li at SmartX. On Thu, Feb 22, 2024 at 7:05=E2=80=AFPM Jeff Layton wr= ote: > > On Wed, 2024-02-21 at 13:48 +0000, Trond Myklebust wrote: > > On Wed, 2024-02-21 at 16:20 +0800, Zhitao Li wrote: > > > [You don't often get email from zhitao.li@smartx.com. Learn why this > > > is important at https://aka.ms/LearnAboutSenderIdentification ] > > > > > > Hi, everyone, > > > > > > - Facts: > > > I have a remote NFS export and I mount the same export on two > > > different directories in my OS with the same options. There is an > > > inflight IO under one mounted directory. And then I unmount another > > > mounted directory with force. The inflight IO ends up with "Unknown > > > error 512", which is ERESTARTSYS. > > > > > > > All of the above is well known. That's because forced umount affects > > the entire filesystem. Why are you using it here in the first place? It > > is not intended for casual use. > > > > While I agree Trond's above statement, the kernel is not supposed to > leak error codes that high into userland. Are you seeing ERESTARTSYS > being returned to system calls? If so, which ones? > -- > Jeff Layton