Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp354486imm; Tue, 24 Jul 2018 21:07:19 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdDkxV44LO0qQbDxYVtnOO21uUMIN+b8ZPHDBmhBt8Hw2vb5t7BlbBMHjEjkgyM+6pIcPKZ X-Received: by 2002:a17:902:b594:: with SMTP id a20-v6mr19686016pls.140.1532491639552; Tue, 24 Jul 2018 21:07:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532491639; cv=none; d=google.com; s=arc-20160816; b=N1OTsIVLaG78oG17OpDnf+QIU6fCcw4fJSBP6qUmooUhBuU1NNiYJQnRy0Hnvf5LcC le4nDoIvuXvJgDkALnNeY7HkV65OCrCbbiidfZnwKJxEihiB0JCrJAb4KI2PtLYNJSZl M4+7Hk/1f+9bA9HC+EuKNxJtfCkjnnwYoc7g252trYUagf3jXx8P8UnnOhKnPudawfp1 ktMAI3lIAXGV+lNLthikbNPCzoSJlRil6EbJvtuVrRVR4R3hnttzpNV5TTwgOL2MgedX 2fgv3+/pqLTxWb4nqqR5UT/bzfXPJInxU/1724Y34nu6bPpo5k2QQE888PfYGng6VU3P 1AQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=CcVMeeDhSnj48AgaC4nqW1s7dNsWIniUSanEH9SIO+E=; b=bCcvb9ZLFvBgEykcApP5wOp4he8u49tRAvfYWgmEq2UL/yVeGROKGRZHw5ZlA7qVNw 01hHWbnM8CIpQYKX4Q4asy/lrk9ZXZ03cTgVq16Cz37eUpmLyVXY+ywV3tUyG9EUJ7Jb mxf8/IytcevLKucc6mHo6xhT7m6eveaw/y4UkuClAp6ETrhr3BA3sxXwqDSdZJaFJX8J JgDCGj4NQtOQVYMhyj04fLrR9f8ih5S3wxC69M+1XwomcNqFFeKxTg3aHtZYg4hUveA7 2hkpd4FaFOfvh4386fysETfKlQKxYMGFdMk2HNtTySf4Cw6Vb0jMEfb9mCnbLLh3ysU/ 5HTw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q10-v6si12894997pge.674.2018.07.24.21.07.04; Tue, 24 Jul 2018 21:07:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727699AbeGYFQA (ORCPT + 99 others); Wed, 25 Jul 2018 01:16:00 -0400 Received: from nautica.notk.org ([91.121.71.147]:35635 "EHLO nautica.notk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727073AbeGYFQA (ORCPT ); Wed, 25 Jul 2018 01:16:00 -0400 Received: by nautica.notk.org (Postfix, from userid 1001) id 0E032C009; Wed, 25 Jul 2018 06:06:15 +0200 (CEST) Date: Wed, 25 Jul 2018 06:06:00 +0200 From: Dominique Martinet To: piaojun Cc: "akpm@linux-foundation.org" , Eric Van Hensbergen , Ron Minnich , Latchesar Ionkov , Linux Kernel Mailing List , v9fs-developer@lists.sourceforge.net, groug@kaod.org Subject: Re: [PATCH] fs/9p/xattr.c: catch the error of p9_client_clunk when setting xattr failed Message-ID: <20180725040600.GA11041@nautica> References: <5B57EACC.2060900@huawei.com> <20180725033200.GA29865@nautica> <5B57F564.9070604@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <5B57F564.9070604@huawei.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org piaojun wrote on Wed, Jul 25, 2018: > On 2018/7/25 11:32, Dominique Martinet wrote: > >> p9_client_write(fid, 0, &from, &retval); > > > > I'm not sure what to do about this but it's also possible for > > p9_client_write to not write the full length without setting and error. > > > > We should probably compare the return value of p9_client_write and > > value_len to detect short writes and return an error in this case. > > It looks like we could identify short writes error from the *err. If no > error case breaks the while loop, the total equal to the whole data len. Ah, I looked too fast and missed the while loop in p9_client_write... It's rather unusual for such a low level call to handle retries, but I guess that's 9p. Right, will take that patch as is then. Thanks, -- Dominique