From patchwork Wed Jan 3 14:59:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 184776 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp5069098dyb; Wed, 3 Jan 2024 07:00:58 -0800 (PST) X-Google-Smtp-Source: AGHT+IHR+0LlX2IboAobsT5GfGN1k5cIthQ4ZdW81H1t/qkG82nzIuX/+7h9+kXZd5t6UV71Lu0w X-Received: by 2002:a17:90a:d3c3:b0:28b:5ffe:2049 with SMTP id d3-20020a17090ad3c300b0028b5ffe2049mr10594867pjw.94.1704294058197; Wed, 03 Jan 2024 07:00:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704294058; cv=none; d=google.com; s=arc-20160816; b=Tqe0sN7WeqrYjBYkWe2iCNvZJWbZtxo0xDPiSp1YFHlChERbguuGMO3AzLpRsHDgJG SWXZWSyIMV0dFk4ASazQgBdBYnWP6P3X2H7RSflKnwDxEf+gADb3woIqbbk953gh2AZ6 GG/ifaj5hQIfSuIne/3w2zFsQonQCKulrnJ7lkSxUBSp5jFD5KF1gQxgDjqgJ8ynUy1N 0mQHNndLyI9o+CjdPnwP8E4tXn5kHm5GvDQDlQ2lvodZXQDd1OPAgphRl0AIlt3y33Yu nfm4ucybp/s5/V6BrzAktmA9VIEacrwWiaxWUBtUGzVVIhPO9lp7CFFq8AQhVArVPEc8 6h8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=SdFCD8YJUNnwtU5qwz/M+xF7ih7tS/QW8qR9RpiR7QY=; fh=6hlFWZUR5wi9f3e2PaIraYIVPbYx15pYt1xJq7VLTTU=; b=sJsK/qyyW7BYYXNXwQqNjrpfZqpq3IGg7IxY8kBFbKD0UnCejDllh5Hrpb35LAh4nD cY8tRlAL/vmH7ELqZ6gBEmV9mKmbjEj7px24pGZwBgQDGM/sH69ces10bRzyPoHZZkWi ZAFI+KN38zpkEJilMmLqa9bTptREg0rCSdEUTGloqzDe9oejBv7Jmc7W4Wr4wHiyE/Oi IHR4C2kpk9nAZMGY23EnfyBR5dIp4zasV5q/JRysxFUnRVsr0t2QqmzoHuqn375aihdz MKQeFj7KJ0xIs47ZrLSUpTJejhCMvPT1sSvgk9BJOh2SUr9Y81T1Shvh+ontpe8Rq29t FYhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NzBP1IFG; spf=pass (google.com: domain of linux-kernel+bounces-15674-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15674-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id w62-20020a638241000000b005cdf8afb67dsi18780120pgd.110.2024.01.03.07.00.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 07:00:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-15674-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NzBP1IFG; spf=pass (google.com: domain of linux-kernel+bounces-15674-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15674-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 5FF21284852 for ; Wed, 3 Jan 2024 15:00:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5A6E71BDD5; Wed, 3 Jan 2024 15:00:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="NzBP1IFG" X-Original-To: linux-kernel@vger.kernel.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 336AA1B292 for ; Wed, 3 Jan 2024 14:59:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1704293997; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=SdFCD8YJUNnwtU5qwz/M+xF7ih7tS/QW8qR9RpiR7QY=; b=NzBP1IFG5kRUehdC9xp0+JWMT8f/3WKEbQ1ao4h8MOMV5w/W7qKprmGHtIUEMmh8seQ98S fRKg0PH1zhR3CgVGVGpIVmogmPVBp1uo44lH9EZZy8X7pnGNG+Ervsgs6f5Nk5zVe5NMZV mCvnYO1Vs+jvGmcCV/cAdxdMp/eEJd0= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-369-l-ZawQD_NwSxVHuoSJh8mg-1; Wed, 03 Jan 2024 09:59:54 -0500 X-MC-Unique: l-ZawQD_NwSxVHuoSJh8mg-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 450EB83B826; Wed, 3 Jan 2024 14:59:53 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.42.28.68]) by smtp.corp.redhat.com (Postfix) with ESMTP id 45F673C27; Wed, 3 Jan 2024 14:59:49 +0000 (UTC) From: David Howells To: Christian Brauner , Jeff Layton , Gao Xiang , Dominique Martinet Cc: David Howells , Steve French , Matthew Wilcox , Marc Dionne , Paulo Alcantara , Shyam Prasad N , Tom Talpey , Eric Van Hensbergen , Ilya Dryomov , linux-cachefs@redhat.com, linux-afs@lists.infradead.org, linux-cifs@vger.kernel.org, linux-nfs@vger.kernel.org, ceph-devel@vger.kernel.org, v9fs@lists.linux.dev, linux-erofs@lists.ozlabs.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Yiqun Leng , Jia Zhu Subject: [PATCH 1/5] cachefiles: Fix __cachefiles_prepare_write() Date: Wed, 3 Jan 2024 14:59:25 +0000 Message-ID: <20240103145935.384404-2-dhowells@redhat.com> In-Reply-To: <20240103145935.384404-1-dhowells@redhat.com> References: <20240103145935.384404-1-dhowells@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.1 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787081846318727185 X-GMAIL-MSGID: 1787081846318727185 Fix __cachefiles_prepare_write() to correctly determine whether the requested write will fit correctly with the DIO alignment. Reported-by: Gao Xiang Signed-off-by: David Howells Tested-by: Yiqun Leng Tested-by: Jia Zhu cc: Jeff Layton cc: linux-cachefs@redhat.com cc: linux-erofs@lists.ozlabs.org cc: linux-fsdevel@vger.kernel.org cc: linux-mm@kvack.org Reported-by: Simon Horman Reported-by: kernel test robot Signed-off-by: David Howells Reviewed-by: Simon Horman --- fs/cachefiles/io.c | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/fs/cachefiles/io.c b/fs/cachefiles/io.c index bffffedce4a9..7529b40bc95a 100644 --- a/fs/cachefiles/io.c +++ b/fs/cachefiles/io.c @@ -522,16 +522,22 @@ int __cachefiles_prepare_write(struct cachefiles_object *object, bool no_space_allocated_yet) { struct cachefiles_cache *cache = object->volume->cache; - loff_t start = *_start, pos; - size_t len = *_len, down; + unsigned long long start = *_start, pos; + size_t len = *_len; int ret; /* Round to DIO size */ - down = start - round_down(start, PAGE_SIZE); - *_start = start - down; - *_len = round_up(down + len, PAGE_SIZE); - if (down < start || *_len > upper_len) + start = round_down(*_start, PAGE_SIZE); + if (start != *_start) { + kleave(" = -ENOBUFS [down]"); + return -ENOBUFS; + } + if (*_len > upper_len) { + kleave(" = -ENOBUFS [up]"); return -ENOBUFS; + } + + *_len = round_up(len, PAGE_SIZE); /* We need to work out whether there's sufficient disk space to perform * the write - but we can skip that check if we have space already @@ -542,7 +548,7 @@ int __cachefiles_prepare_write(struct cachefiles_object *object, pos = cachefiles_inject_read_error(); if (pos == 0) - pos = vfs_llseek(file, *_start, SEEK_DATA); + pos = vfs_llseek(file, start, SEEK_DATA); if (pos < 0 && pos >= (loff_t)-MAX_ERRNO) { if (pos == -ENXIO) goto check_space; /* Unallocated tail */ @@ -550,7 +556,7 @@ int __cachefiles_prepare_write(struct cachefiles_object *object, cachefiles_trace_seek_error); return pos; } - if ((u64)pos >= (u64)*_start + *_len) + if (pos >= start + *_len) goto check_space; /* Unallocated region */ /* We have a block that's at least partially filled - if we're low on @@ -563,13 +569,13 @@ int __cachefiles_prepare_write(struct cachefiles_object *object, pos = cachefiles_inject_read_error(); if (pos == 0) - pos = vfs_llseek(file, *_start, SEEK_HOLE); + pos = vfs_llseek(file, start, SEEK_HOLE); if (pos < 0 && pos >= (loff_t)-MAX_ERRNO) { trace_cachefiles_io_error(object, file_inode(file), pos, cachefiles_trace_seek_error); return pos; } - if ((u64)pos >= (u64)*_start + *_len) + if (pos >= start + *_len) return 0; /* Fully allocated */ /* Partially allocated, but insufficient space: cull. */ @@ -577,7 +583,7 @@ int __cachefiles_prepare_write(struct cachefiles_object *object, ret = cachefiles_inject_remove_error(); if (ret == 0) ret = vfs_fallocate(file, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, - *_start, *_len); + start, *_len); if (ret < 0) { trace_cachefiles_io_error(object, file_inode(file), ret, cachefiles_trace_fallocate_error); From patchwork Wed Jan 3 14:59:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 184777 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp5069593dyb; Wed, 3 Jan 2024 07:01:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IGt0oT8DwP9XxN4+a7QfBypgLu75xdd+U+ruWaeoMtlQ9KRUzUzc4j0ylGq2EOZaGNsc3An X-Received: by 2002:aca:1708:0:b0:3bc:1a73:2945 with SMTP id j8-20020aca1708000000b003bc1a732945mr2024397oii.59.1704294088142; Wed, 03 Jan 2024 07:01:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704294088; cv=none; d=google.com; s=arc-20160816; b=qPgg5r/XSvIyenMDllljCKWF8fiH/z4WAbnmhHZgbq9O94Te6P6PjDjhvuAncfGxL/ 5ULb4B4xC4shzVfGQtIxlf24OlThFsqy9c71l2A1hesH9tGABo3jkfdroS6Oz9YAIBWW PLhdVmQNssFfPDte8285d5WZe+nJ1qZV7n8O3vMw3A0jO/DSdycDFjWuOdFeC8G3An7j TqMRBv5lpDcwv5NIdj8g0xDEyCheXSJ3DP6rSIqagmDp6tsONiuGpVq3QMP1JygLv0XR 0P9P2zErgfD/4NCBC5rgtsLRcTLpCcxJBsIYffMkvRGY3aDqmTKaX9xRzx4xzlCfIJC2 0icw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=MeAO0oSTBeeKS0vYZcWZAv5QaziKwPxfd8eozSQVml8=; fh=z2lFNIQm1BYTiGQWz0rp4lP3BVSA1n5g+uZ/88gyKRg=; b=CqKDTIk9H5t+6ZpuA3krZnYx3UvFep3kPOXUHvzZ4tYpxMHCt3yEVaR8kY3psBz0zY 6L5yrBtIRXPTOM8t/BK+XNoqvtBx9aW9MYMpVOYaCA8Luu4/stG9CvBamp49WNjJlP07 MOMoXb0Ntt5jkj530/6WnNTlBf5/nWXLvP2YdzpwRKxtcX0fpHWb2bRnphdnwdNuTt4U z9KNwxILh9xCH4cvS9MXwv6G2GaYw8JbO9dZbmKFpZogk0JvaULGgVSFFbket0kR78NR BZlKmv3O+a3038w879D8pCcy5e9+aQ8SPl4yn98b/fQ7z5tWBvWo4VRzhKaQV2E+jn3g tv3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="Z/r905Ed"; spf=pass (google.com: domain of linux-kernel+bounces-15675-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15675-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id y20-20020a0cf154000000b0067f692cf830si26145886qvl.128.2024.01.03.07.01.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 07:01:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-15675-ouuuleilei=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=@redhat.com header.s=mimecast20190719 header.b="Z/r905Ed"; spf=pass (google.com: domain of linux-kernel+bounces-15675-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15675-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com 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 E5A3F1C237BC for ; Wed, 3 Jan 2024 15:01:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 708BB1C6A4; Wed, 3 Jan 2024 15:00:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Z/r905Ed" X-Original-To: linux-kernel@vger.kernel.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 721B41BDE3 for ; Wed, 3 Jan 2024 15:00:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1704294005; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MeAO0oSTBeeKS0vYZcWZAv5QaziKwPxfd8eozSQVml8=; b=Z/r905EdIOlGjWxXvb/PkAebcmdvD4nfY6zQdPxR7azq9KOlc9hdMNwJbAxM0lTMYd6puG sO/fJ2gnV2dWPC0XuaC6yJzRj77mqEKEmIAKpYwPzdLe7LdiKKXUt87mWb9lXjW0PBqAu2 ZJGqPnggMgrhUJcjpZN4LPSbnxYkmQs= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-463-cI1hlP01MuqdOORVRFc1ug-1; Wed, 03 Jan 2024 09:59:59 -0500 X-MC-Unique: cI1hlP01MuqdOORVRFc1ug-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 355D6185A793; Wed, 3 Jan 2024 14:59:58 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.42.28.68]) by smtp.corp.redhat.com (Postfix) with ESMTP id 03EE83C30; Wed, 3 Jan 2024 14:59:53 +0000 (UTC) From: David Howells To: Christian Brauner , Jeff Layton , Gao Xiang , Dominique Martinet Cc: David Howells , Steve French , Matthew Wilcox , Marc Dionne , Paulo Alcantara , Shyam Prasad N , Tom Talpey , Eric Van Hensbergen , Ilya Dryomov , linux-cachefs@redhat.com, linux-afs@lists.infradead.org, linux-cifs@vger.kernel.org, linux-nfs@vger.kernel.org, ceph-devel@vger.kernel.org, v9fs@lists.linux.dev, linux-erofs@lists.ozlabs.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Latchesar Ionkov , Christian Schoenebeck Subject: [PATCH 2/5] 9p: Fix initialisation of netfs_inode for 9p Date: Wed, 3 Jan 2024 14:59:26 +0000 Message-ID: <20240103145935.384404-3-dhowells@redhat.com> In-Reply-To: <20240103145935.384404-1-dhowells@redhat.com> References: <20240103145935.384404-1-dhowells@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.1 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787081877285833677 X-GMAIL-MSGID: 1787081877285833677 The 9p filesystem is calling netfs_inode_init() in v9fs_init_inode() - before the struct inode fields have been initialised from the obtained file stats (ie. after v9fs_stat2inode*() has been called), but netfslib wants to set a couple of its fields from i_size. Reported-by: Marc Dionne Signed-off-by: David Howells Tested-by: Marc Dionne Tested-by: Dominique Martinet Acked-by: Dominique Martinet cc: Eric Van Hensbergen cc: Latchesar Ionkov cc: Dominique Martinet cc: Christian Schoenebeck cc: v9fs@lists.linux.dev cc: linux-cachefs@redhat.com cc: linux-fsdevel@vger.kernel.org --- fs/9p/v9fs_vfs.h | 1 + fs/9p/vfs_inode.c | 6 +++--- fs/9p/vfs_inode_dotl.c | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/fs/9p/v9fs_vfs.h b/fs/9p/v9fs_vfs.h index 731e3d14b67d..0e8418066a48 100644 --- a/fs/9p/v9fs_vfs.h +++ b/fs/9p/v9fs_vfs.h @@ -42,6 +42,7 @@ struct inode *v9fs_alloc_inode(struct super_block *sb); void v9fs_free_inode(struct inode *inode); struct inode *v9fs_get_inode(struct super_block *sb, umode_t mode, dev_t rdev); +void v9fs_set_netfs_context(struct inode *inode); int v9fs_init_inode(struct v9fs_session_info *v9ses, struct inode *inode, umode_t mode, dev_t rdev); void v9fs_evict_inode(struct inode *inode); diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c index b66466e97459..32572982f72e 100644 --- a/fs/9p/vfs_inode.c +++ b/fs/9p/vfs_inode.c @@ -246,7 +246,7 @@ void v9fs_free_inode(struct inode *inode) /* * Set parameters for the netfs library */ -static void v9fs_set_netfs_context(struct inode *inode) +void v9fs_set_netfs_context(struct inode *inode) { struct v9fs_inode *v9inode = V9FS_I(inode); netfs_inode_init(&v9inode->netfs, &v9fs_req_ops, true); @@ -326,8 +326,6 @@ int v9fs_init_inode(struct v9fs_session_info *v9ses, err = -EINVAL; goto error; } - - v9fs_set_netfs_context(inode); error: return err; @@ -359,6 +357,7 @@ struct inode *v9fs_get_inode(struct super_block *sb, umode_t mode, dev_t rdev) iput(inode); return ERR_PTR(err); } + v9fs_set_netfs_context(inode); return inode; } @@ -461,6 +460,7 @@ static struct inode *v9fs_qid_iget(struct super_block *sb, goto error; v9fs_stat2inode(st, inode, sb, 0); + v9fs_set_netfs_context(inode); v9fs_cache_inode_get_cookie(inode); unlock_new_inode(inode); return inode; diff --git a/fs/9p/vfs_inode_dotl.c b/fs/9p/vfs_inode_dotl.c index e25fbc988f09..3505227e1704 100644 --- a/fs/9p/vfs_inode_dotl.c +++ b/fs/9p/vfs_inode_dotl.c @@ -128,6 +128,7 @@ static struct inode *v9fs_qid_iget_dotl(struct super_block *sb, goto error; v9fs_stat2inode_dotl(st, inode, 0); + v9fs_set_netfs_context(inode); v9fs_cache_inode_get_cookie(inode); retval = v9fs_get_acl(inode, fid); if (retval) From patchwork Wed Jan 3 14:59:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 184778 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp5070192dyb; Wed, 3 Jan 2024 07:02:06 -0800 (PST) X-Google-Smtp-Source: AGHT+IEGhWVvQbjrHsCrjYWp2Pscijq1uwyx1/ROxbCmgLjKQI7RIT73puIF3qhvc+jQPSl9TF+k X-Received: by 2002:a17:902:dad2:b0:1d4:cbfc:1ccb with SMTP id q18-20020a170902dad200b001d4cbfc1ccbmr2040050plx.64.1704294126159; Wed, 03 Jan 2024 07:02:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704294126; cv=none; d=google.com; s=arc-20160816; b=Nm/OKdFPT1DfhpG+gY+W8/gZnelKu21QeNlR+GJifsBfmugcPW23iqk9SXQBVRb8Of 3IFfiDWGk/VBxoU2RcUZ9dJfZSim7o3B5b5eRYTmOYUlqaxCzIOmopaVkbnZya/6h38R 4N2L2n/t4EBeoA756nDcf7ldU7QZwFOFVPqaS200WdRSutZQm+7BXWyge5TsbGI4ef7n 1azInxDGZoQvF5Z9fcGbNwuGmc+uNUfXgBmKxwzEgL4SyIU1TfYYad1tQEfRR7zuy8hP OMy9pdlAQBH0ZXpVWg0Wy9ccgXo0ChXZXfPXBHTPwKJ9WwwoQhFnvGZThZInK8vvfUCJ hSZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=ZUPriBHgZCe048XAouZ6FVZlUrGVgRcZGkDmJ6vhI+o=; fh=z2lFNIQm1BYTiGQWz0rp4lP3BVSA1n5g+uZ/88gyKRg=; b=MCqQjThPHiY/wSieSOUZj4VlkbS1GEXWMCZDKNqk0Bys9tBRJtsaldruYA/zLbdpeR /O//0O141NimUdCKXTDZIJonB3Mk0ssMWa5obPdWEzPGnghCZzOrYH6Cmhx4po5qx7Io aOSz0cMG4qlXS3cQIVCYI4RX589JdmW0D4FBAj7XpVeawFk+pAyVroeb/MvBjqSzvPGh Q6qaxIhLBc52F+FrbZyxW9j2S1fhUsVYnO8LqfdL20w6kVW1ztrOnW7Knr4LubRKiRI/ VHt2urDuFxMtgTUbeoaRZldGqt6B2lh/yw0/LkcntT2OmqPzmweP12j5gKFEsXrZyvW7 ZROw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZcosswAf; spf=pass (google.com: domain of linux-kernel+bounces-15676-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15676-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 13-20020a170902e9cd00b001d3d85be895si21730338plk.135.2024.01.03.07.02.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 07:02:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-15676-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZcosswAf; spf=pass (google.com: domain of linux-kernel+bounces-15676-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15676-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 161DF286299 for ; Wed, 3 Jan 2024 15:01:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 96DF01CA86; Wed, 3 Jan 2024 15:00:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="ZcosswAf" X-Original-To: linux-kernel@vger.kernel.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9D3FD1C29E for ; Wed, 3 Jan 2024 15:00:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1704294007; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZUPriBHgZCe048XAouZ6FVZlUrGVgRcZGkDmJ6vhI+o=; b=ZcosswAfmwuQQDPOw/u+XeeOx1T9QEmw5bQsPu+2eaHVWQghGX+4v0Ohw65WDkCa1vRvrH WBQc9uwCEP52J6hMbCRYzfFoksEbM1i1J4wbGGV9ik3D+xYqkH9Xo9DaWiw8ChX5jK+UoW kFuiqPUeTPM4z3mQbRkheUySAX6hhdI= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-194-mFIdXobHMneufCW3dOaAMw-1; Wed, 03 Jan 2024 10:00:04 -0500 X-MC-Unique: mFIdXobHMneufCW3dOaAMw-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7FA74185A780; Wed, 3 Jan 2024 15:00:02 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.42.28.68]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0074C3C30; Wed, 3 Jan 2024 14:59:58 +0000 (UTC) From: David Howells To: Christian Brauner , Jeff Layton , Gao Xiang , Dominique Martinet Cc: David Howells , Steve French , Matthew Wilcox , Marc Dionne , Paulo Alcantara , Shyam Prasad N , Tom Talpey , Eric Van Hensbergen , Ilya Dryomov , linux-cachefs@redhat.com, linux-afs@lists.infradead.org, linux-cifs@vger.kernel.org, linux-nfs@vger.kernel.org, ceph-devel@vger.kernel.org, v9fs@lists.linux.dev, linux-erofs@lists.ozlabs.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Latchesar Ionkov , Christian Schoenebeck Subject: [PATCH 3/5] 9p: Do a couple of cleanups Date: Wed, 3 Jan 2024 14:59:27 +0000 Message-ID: <20240103145935.384404-4-dhowells@redhat.com> In-Reply-To: <20240103145935.384404-1-dhowells@redhat.com> References: <20240103145935.384404-1-dhowells@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.1 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787081917895879859 X-GMAIL-MSGID: 1787081917895879859 Do a couple of cleanups to 9p: (1) Remove a couple of unused variables. (2) Turn a BUG_ON() into a warning, consolidate with another warning and make the warning message include the inode number rather than whatever's in i_private (which will get hashed anyway). Suggested-by: Dominique Martinet Link: https://lore.kernel.org/r/ZZULNQAZ0n0WQv7p@codewreck.org/ Signed-off-by: David Howells cc: Eric Van Hensbergen cc: Latchesar Ionkov cc: Christian Schoenebeck cc: v9fs@lists.linux.dev cc: linux-cachefs@redhat.com cc: linux-fsdevel@vger.kernel.org Acked-by: Dominique Martinet --- fs/9p/vfs_addr.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/fs/9p/vfs_addr.c b/fs/9p/vfs_addr.c index d8fb407189a0..f7f83eec3bcc 100644 --- a/fs/9p/vfs_addr.c +++ b/fs/9p/vfs_addr.c @@ -28,8 +28,6 @@ static void v9fs_upload_to_server(struct netfs_io_subrequest *subreq) { - struct inode *inode = subreq->rreq->inode; - struct v9fs_inode __maybe_unused *v9inode = V9FS_I(inode); struct p9_fid *fid = subreq->rreq->netfs_priv; int err; @@ -98,15 +96,13 @@ static int v9fs_init_request(struct netfs_io_request *rreq, struct file *file) if (file) { fid = file->private_data; - BUG_ON(!fid); + if (!fid) + goto no_fid; p9_fid_get(fid); } else { fid = v9fs_fid_find_inode(rreq->inode, writing, INVALID_UID, true); - if (!fid) { - WARN_ONCE(1, "folio expected an open fid inode->i_private=%p\n", - rreq->inode->i_private); - return -EINVAL; - } + if (!fid) + goto no_fid; } /* we might need to read from a fid that was opened write-only @@ -115,6 +111,11 @@ static int v9fs_init_request(struct netfs_io_request *rreq, struct file *file) WARN_ON(rreq->origin == NETFS_READ_FOR_WRITE && !(fid->mode & P9_ORDWR)); rreq->netfs_priv = fid; return 0; + +no_fid: + WARN_ONCE(1, "folio expected an open fid inode->i_ino=%lx\n", + rreq->inode->i_ino); + return -EINVAL; } /** From patchwork Wed Jan 3 14:59:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 184779 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp5070229dyb; Wed, 3 Jan 2024 07:02:08 -0800 (PST) X-Google-Smtp-Source: AGHT+IEQ0hHb5jL761M8KrR9CoK+bQZkAzmGcX5DT4t23yn/9eE0urpDSlDiSizkSHBAO5vznyNn X-Received: by 2002:a05:622a:28b:b0:428:26e0:4e4f with SMTP id z11-20020a05622a028b00b0042826e04e4fmr1924261qtw.43.1704294128401; Wed, 03 Jan 2024 07:02:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704294128; cv=none; d=google.com; s=arc-20160816; b=WPHP7DvunRgXRJLZOIzsLZKUS6ivZX1tXY+S0yC3uIvm54bZZRXwv0HUA18PeCTfW9 wdWwglchTozEAtOqsL3jkzvbn1CEHiX+SZhLQinAjEbp6+uVpPIa0de7gbtf2N6wCypj fVYBzwKHdL8fcIn2EoDAXHVwD1C91apOUZ1uWPb/kUrfEWqQf3k34cMRyun8uyGg1iJE cIHRIi2VxKJbTgZ9iCuIqAzrYyDJs1L68nOujAUEv6QqI9aYuJ48op0DWFuoxHqTut5O oIaB8jS2pma1vET0LoUox1RS+gV9YNurLsRLUAmpccnqlhWK9n6q2ZBk4c8Mzk1Ja2f8 CfzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=l/klC/ghutWIOc1+EVzXLrxXcGHqt0/sieVr6S5RVKE=; fh=z2lFNIQm1BYTiGQWz0rp4lP3BVSA1n5g+uZ/88gyKRg=; b=o4egXKYffVz5CDXSz3VDL8uKvrcn2HPp1x0eezCtCgTVlqDTIyPRCjLNaWa4z0wDI0 ag1S+C16K9n4xSUDgTKnzlDL0wS3LZUhqrS3NdNVfHcQiOwNssc2VBlDysfqdoZdOROt 8a8zCGGAn2SeeTPY2pHys+jrkki1Cpk6oQdWziG3sT8QUhoRfR8vvfiNLZeTe7eohcu1 NHbc+c0zH9whLm/Oh2Y3BAMt1mWcLEn720cLSrqYqTAxEqe89+KzvnrE31fHCaZv1RQH 8Lc86gebFvgB1+LCIBP5NRtKW/1S+0lSldLjzJ8aqK74Gq9HDLjoC1qJnZhz2cfU9LoW k8BA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=I2RRQhAt; spf=pass (google.com: domain of linux-kernel+bounces-15677-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15677-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id a9-20020a05622a02c900b00427edcb92f4si16207633qtx.696.2024.01.03.07.02.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 07:02:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-15677-ouuuleilei=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=@redhat.com header.s=mimecast20190719 header.b=I2RRQhAt; spf=pass (google.com: domain of linux-kernel+bounces-15677-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15677-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com 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 920361C23619 for ; Wed, 3 Jan 2024 15:02:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6B0371CAB9; Wed, 3 Jan 2024 15:00:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="I2RRQhAt" X-Original-To: linux-kernel@vger.kernel.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 72A381C6BB for ; Wed, 3 Jan 2024 15:00:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1704294010; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=l/klC/ghutWIOc1+EVzXLrxXcGHqt0/sieVr6S5RVKE=; b=I2RRQhAtR0U6CIFcuP0WxIk3ksIfzqL1+Uugo2DFFFm29BLVDiKREvr4FtIBEJnlCZa4KJ nv4P2K7CFWKT6GW0bT96NbXBK4qbn9Fn9bDgwrJs2HDc9UAg+slXL020NVHlzOb+TpBQW/ Fg/OoScWLNf/PnIExA18QmTB2aPiV9s= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-14-L2AWb4usNJ6xafig_4JuOw-1; Wed, 03 Jan 2024 10:00:08 -0500 X-MC-Unique: L2AWb4usNJ6xafig_4JuOw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4C7D38F4126; Wed, 3 Jan 2024 15:00:06 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.42.28.68]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2DFEE2026D66; Wed, 3 Jan 2024 15:00:03 +0000 (UTC) From: David Howells To: Christian Brauner , Jeff Layton , Gao Xiang , Dominique Martinet Cc: David Howells , Steve French , Matthew Wilcox , Marc Dionne , Paulo Alcantara , Shyam Prasad N , Tom Talpey , Eric Van Hensbergen , Ilya Dryomov , linux-cachefs@redhat.com, linux-afs@lists.infradead.org, linux-cifs@vger.kernel.org, linux-nfs@vger.kernel.org, ceph-devel@vger.kernel.org, v9fs@lists.linux.dev, linux-erofs@lists.ozlabs.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Latchesar Ionkov , Christian Schoenebeck Subject: [PATCH 4/5] 9p: Always update remote_i_size in stat2inode Date: Wed, 3 Jan 2024 14:59:28 +0000 Message-ID: <20240103145935.384404-5-dhowells@redhat.com> In-Reply-To: <20240103145935.384404-1-dhowells@redhat.com> References: <20240103145935.384404-1-dhowells@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.4 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787081919758459590 X-GMAIL-MSGID: 1787081919758459590 Always update remote_i_size in v9fs_stat2inode*() if the size is available, even if we are asked not to update i_isize Suggested-by: Dominique Martinet Link: https://lore.kernel.org/r/ZZVctju5TEjS218p@codewreck.org/ Signed-off-by: David Howells cc: Eric Van Hensbergen cc: Latchesar Ionkov cc: Christian Schoenebeck cc: v9fs@lists.linux.dev cc: linux-cachefs@redhat.com cc: linux-fsdevel@vger.kernel.org --- fs/9p/vfs_inode_dotl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/9p/vfs_inode_dotl.c b/fs/9p/vfs_inode_dotl.c index 3505227e1704..aa3a77bb5e86 100644 --- a/fs/9p/vfs_inode_dotl.c +++ b/fs/9p/vfs_inode_dotl.c @@ -684,10 +684,10 @@ v9fs_stat2inode_dotl(struct p9_stat_dotl *stat, struct inode *inode, mode |= inode->i_mode & ~S_IALLUGO; inode->i_mode = mode; } - if (!(flags & V9FS_STAT2INODE_KEEP_ISIZE) && - stat->st_result_mask & P9_STATS_SIZE) { + if (stat->st_result_mask & P9_STATS_SIZE) { v9inode->netfs.remote_i_size = stat->st_size; - v9fs_i_size_write(inode, stat->st_size); + if (!(flags & V9FS_STAT2INODE_KEEP_ISIZE)) + v9fs_i_size_write(inode, stat->st_size); } if (stat->st_result_mask & P9_STATS_BLOCKS) inode->i_blocks = stat->st_blocks; From patchwork Wed Jan 3 14:59:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 184780 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp5070670dyb; Wed, 3 Jan 2024 07:02:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IGSQxrBc7qBeTwz+eH+2vEdN5PnoSMVAEWx9v+7qG/KSDcDxfOMsjWuUjTSHXBD/HGQrVd9 X-Received: by 2002:a17:903:1ca:b0:1d4:25ec:5975 with SMTP id e10-20020a17090301ca00b001d425ec5975mr26403040plh.10.1704294157420; Wed, 03 Jan 2024 07:02:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704294157; cv=none; d=google.com; s=arc-20160816; b=RKbizqzg+kSIqvCS5LHHjgiXnmtP3TjSJFev1YjIJxGXrbAsRjI4sbzByQMRRM0iMi DozKRaQjUxV7l6gBWSZJwNB0qbxK3snHWAduj6mZFgTQINv7pK+auXSeXeE9pf1b1pBz 7gad0ooc57CDcfOEAEBCj5AlAzQDeZ+cCrV/JVOqlT2QVUvNbTej2YeVpcqSbufTxmJw yz6z11pAcj/p10HoWeryxA564HNCKgHwTPMN9PfZ8iuDzIXDzvN2Z2rLZXtH9uitVNqa 5da23gOyh1aAZBSKMv/PhfZQpn345fe7w02y3HrBNt6xXk2aj/r28FiBHZCJwNMOWvVP HaUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=7QMJZ+3lHeykV3WPSbajID2T4bzMyvXitF+gI+XPTjU=; fh=z2lFNIQm1BYTiGQWz0rp4lP3BVSA1n5g+uZ/88gyKRg=; b=D8CKinXTi3lU5T1NCy4Q525nyeC8OLTVGFrhyYCPJA5lXyQ+oMy8QVrg0c8cu3wfDj y9qDd0r0KJd3F9cLpM61avqvtYmHzX7Iwj19h6StuG0YMHzNCA0u/+L5YDTHl79EjQhq MGrhWI06gopQjxo/xspeVzRPWwDnwaRAtiKdzGgd9fHUT9edZ229t/hmrJwwPDm1mvu8 ZwXDb1zZ7EetV9O2TSgZmSPhIjOLD+GEL1hGZ63jdc/YgqDNEmegnIKs5y5JrQEzf03z GcJytjdyetcpiBveXqL9NKPV1FaxSmCeYPXXPt4nUMtMzf+Xq6C0eofPx2+TiGuoVmgX kygg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=WlvIIMQY; spf=pass (google.com: domain of linux-kernel+bounces-15678-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15678-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id k6-20020a170902c40600b001d4c2bdf001si3503279plk.436.2024.01.03.07.02.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 07:02:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-15678-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=WlvIIMQY; spf=pass (google.com: domain of linux-kernel+bounces-15678-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15678-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 74998B232C7 for ; Wed, 3 Jan 2024 15:02:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E36231D52A; Wed, 3 Jan 2024 15:00:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="WlvIIMQY" X-Original-To: linux-kernel@vger.kernel.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4EEFC1CF8A for ; Wed, 3 Jan 2024 15:00:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1704294016; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7QMJZ+3lHeykV3WPSbajID2T4bzMyvXitF+gI+XPTjU=; b=WlvIIMQY0Jc70EjRsDm3sWLi9Edks09+k12WzFYdIz6MkmSMAgYdFppVcZRRiyAzDO98EQ L/V8725gWJnJeFp2y9pu1q9Mb9X/v9G5vy5rOvpLAQJGWVr2OK9lknruEOsifKbioInJZI Yr3skH16iF4m2ohBfQZVaZE0keA3Hxw= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-590-aceTF6bhNCidJMmyrfkt8A-1; Wed, 03 Jan 2024 10:00:12 -0500 X-MC-Unique: aceTF6bhNCidJMmyrfkt8A-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4AA321E441CA; Wed, 3 Jan 2024 15:00:10 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.42.28.68]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1A2D21121306; Wed, 3 Jan 2024 15:00:06 +0000 (UTC) From: David Howells To: Christian Brauner , Jeff Layton , Gao Xiang , Dominique Martinet Cc: David Howells , Steve French , Matthew Wilcox , Marc Dionne , Paulo Alcantara , Shyam Prasad N , Tom Talpey , Eric Van Hensbergen , Ilya Dryomov , linux-cachefs@redhat.com, linux-afs@lists.infradead.org, linux-cifs@vger.kernel.org, linux-nfs@vger.kernel.org, ceph-devel@vger.kernel.org, v9fs@lists.linux.dev, linux-erofs@lists.ozlabs.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Latchesar Ionkov , Christian Schoenebeck Subject: [PATCH 5/5] 9p: Use length of data written to the server in preference to error Date: Wed, 3 Jan 2024 14:59:29 +0000 Message-ID: <20240103145935.384404-6-dhowells@redhat.com> In-Reply-To: <20240103145935.384404-1-dhowells@redhat.com> References: <20240103145935.384404-1-dhowells@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787081950458119650 X-GMAIL-MSGID: 1787081950458119650 In v9fs_upload_to_server(), we pass the error to netfslib to terminate the subreq rather than the amount of data written - even if we did actually write something. Further, we assume that the write is always entirely done if successful - but it might have been partially complete - as returned by p9_client_write(), but we ignore that. Fix this by indicating the amount written by preference and only returning the error if we didn't write anything. (We might want to return both in future if both are available as this might be useful as to whether we retry or not.) Suggested-by: Dominique Martinet Link: https://lore.kernel.org/r/ZZULNQAZ0n0WQv7p@codewreck.org/ Signed-off-by: David Howells cc: Eric Van Hensbergen cc: Latchesar Ionkov cc: Christian Schoenebeck cc: v9fs@lists.linux.dev cc: linux-cachefs@redhat.com cc: linux-fsdevel@vger.kernel.org Acked-by: Dominique Martinet --- fs/9p/vfs_addr.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/fs/9p/vfs_addr.c b/fs/9p/vfs_addr.c index f7f83eec3bcc..047855033d32 100644 --- a/fs/9p/vfs_addr.c +++ b/fs/9p/vfs_addr.c @@ -29,12 +29,11 @@ static void v9fs_upload_to_server(struct netfs_io_subrequest *subreq) { struct p9_fid *fid = subreq->rreq->netfs_priv; - int err; + int err, len; trace_netfs_sreq(subreq, netfs_sreq_trace_submit); - p9_client_write(fid, subreq->start, &subreq->io_iter, &err); - netfs_write_subrequest_terminated(subreq, err < 0 ? err : subreq->len, - false); + len = p9_client_write(fid, subreq->start, &subreq->io_iter, &err); + netfs_write_subrequest_terminated(subreq, len ?: err, false); } static void v9fs_upload_to_server_worker(struct work_struct *work) From patchwork Wed Jan 3 15:47:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 184785 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp5097599dyb; Wed, 3 Jan 2024 07:48:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IGynn5P07L8A6adPe4KFO4JNDX1BMBroSiz+BB4c++RqYNrE9GH2UKjoq/4asi92XvrGEAt X-Received: by 2002:a05:6a20:9757:b0:197:239:8a7a with SMTP id hs23-20020a056a20975700b0019702398a7amr2269212pzc.117.1704296880734; Wed, 03 Jan 2024 07:48:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704296880; cv=none; d=google.com; s=arc-20160816; b=hGuNkhl0ariGEqeJoI78cjwrEBOWXhkDqed4Ifa3zA+UOfsOGDEnYCmFzlLvpCnKie 7goK5mEdxYPjsMsFzSNPOV6NbVJ/4qp/JRr0MGN569yKzjycXKhtgF9ZWclHbr99HazJ IHClcOistzgClYIav0covrzwhvh7JD1dd+g80dCGVDHhcmIHFLUGcFVdOxJWiPcPXmao qx4uH+nHiRQPCVcu/P4GflpFmL6+GBKFfodlmOlcQ0EVpsvGtZBYKzpYPFbmF+QiXn/X 0SFWAQB/Ab8o8N1QmAUknmS0Jftx1q3oczeyVKfVZZPKkVB7B1MjLlQ0trFevzeTKacU TAWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:content-id:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:subject:cc:to:references :in-reply-to:from:organization:dkim-signature; bh=T4zshVgbXU4KADwit5ys0TaPmzA2s1+8lP1tq0kT5oQ=; fh=QZlVHPyl8yYa5caLwIeYCrH2oilTyNh0FuJMluNO+3A=; b=Y3djmnbNBG21Cn7T+3NhwV/RS0QTimzTC1iocY++rx3T/k/amVJ/Aep8W9ZrQfZ25o pUkv1z6gKB/pJQLkvTwkTGEqqcsoerd1bsWzK3O4neP6dMXeJZrK4HDueIFpXgGbr5mU r+sOYdZV9OJaWI+yyVr4cfuEHNYEjzoECNBXzBhD282Ksg5qSgaV0wnQZrPdlBeTQsno 3uPJXRzpLZ9Xycrmtem4cdnOhLPLpXq2HXkxY63wwgAiFsHnbBvGVXMvGgNlwCwpm0J0 6qoKxgMZlTfQEZ4yyCuqymRDqMx4CzXGqK42g8Xg3Z1pBpDzxrNpdOOOdfk+QMLt4QX2 qjFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=BGMgJIQW; spf=pass (google.com: domain of linux-kernel+bounces-15713-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15713-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id x2-20020a17090a8a8200b0028cb0ebb003si1397904pjn.90.2024.01.03.07.48.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 07:48:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-15713-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=BGMgJIQW; spf=pass (google.com: domain of linux-kernel+bounces-15713-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15713-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 84D7D285FA8 for ; Wed, 3 Jan 2024 15:48:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EB7811BDEE; Wed, 3 Jan 2024 15:47:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="BGMgJIQW" X-Original-To: linux-kernel@vger.kernel.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 008661B26F for ; Wed, 3 Jan 2024 15:47:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1704296842; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=T4zshVgbXU4KADwit5ys0TaPmzA2s1+8lP1tq0kT5oQ=; b=BGMgJIQW67XbbSphRTd+MzDxQd79LorGW3BfG2KPsbsIetz8XNtPEcWeSBcpDbBRpk9VoK EG8rV3LJ2iygbgTEl8DJ2GJ4V47UOLzNlqUiY59/iMZ+yGgxixiGnRZZ4K+VUEXjFkLHCs hfLRZ64w/0qZptKPpHsdKb8c+fmjk/4= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-586-Lmp8D3ZiP6Ojc5GmI18XTw-1; Wed, 03 Jan 2024 10:47:15 -0500 X-MC-Unique: Lmp8D3ZiP6Ojc5GmI18XTw-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A2F02884346; Wed, 3 Jan 2024 15:47:13 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.42.28.68]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6923E492BE6; Wed, 3 Jan 2024 15:47:10 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: <20240103145935.384404-1-dhowells@redhat.com> References: <20240103145935.384404-1-dhowells@redhat.com> To: Christian Brauner , Jeff Layton Cc: dhowells@redhat.com, Gao Xiang , Dominique Martinet , Steve French , Matthew Wilcox , Marc Dionne , Paulo Alcantara , Shyam Prasad N , Tom Talpey , Eric Van Hensbergen , Ilya Dryomov , linux-cachefs@redhat.com, linux-afs@lists.infradead.org, linux-cifs@vger.kernel.org, linux-nfs@vger.kernel.org, ceph-devel@vger.kernel.org, v9fs@lists.linux.dev, linux-erofs@lists.ozlabs.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 6/5] netfs: Rearrange netfs_io_subrequest to put request pointer first Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-ID: <396880.1704296824.1@warthog.procyon.org.uk> Date: Wed, 03 Jan 2024 15:47:04 +0000 Message-ID: <396881.1704296824@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787084806434210294 X-GMAIL-MSGID: 1787084806434210294 netfs: Rearrange netfs_io_subrequest to put request pointer first Rearrange the netfs_io_subrequest struct to put the netfs_io_request pointer (rreq) first. This then allows netfs_io_subrequest to be put in a union with a pointer to a wrapper around netfs_io_request. This will be useful in the future for cifs and maybe ceph. Signed-off-by: David Howells cc: Steve French cc: Shyam Prasad N cc: Rohith Surabattula cc: Jeff Layton cc: linux-cifs@vger.kernel.org cc: linux-cachefs@redhat.com cc: linux-fsdevel@vger.kernel.org cc: linux-mm@kvack.org --- include/linux/netfs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/netfs.h b/include/linux/netfs.h index 852956aa3c4b..d3bac60fcd6f 100644 --- a/include/linux/netfs.h +++ b/include/linux/netfs.h @@ -204,8 +204,8 @@ struct netfs_cache_resources { * the pages it points to can be relied on to exist for the duration. */ struct netfs_io_subrequest { - struct work_struct work; struct netfs_io_request *rreq; /* Supervising I/O request */ + struct work_struct work; struct list_head rreq_link; /* Link in rreq->subrequests */ struct iov_iter io_iter; /* Iterator for this subrequest */ loff_t start; /* Where to start the I/O */ From patchwork Wed Jan 3 21:15:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 184848 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp5269375dyb; Wed, 3 Jan 2024 13:16:19 -0800 (PST) X-Google-Smtp-Source: AGHT+IGh7/NBkZjo3Vg7nmLyX/YCJDAovHQqTYIKUU4GPwzHrtKAQ/q0Fa650qtYGEr44QcIOzTy X-Received: by 2002:a05:620a:1441:b0:781:c22:c097 with SMTP id i1-20020a05620a144100b007810c22c097mr21535606qkl.11.1704316579565; Wed, 03 Jan 2024 13:16:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704316579; cv=none; d=google.com; s=arc-20160816; b=kP4k4WC7CFHqSbUmA58zM6yT8foijfAhzHAdidWSM07J034GsAiL/ZXjPP5KVE4EzO ItxfjuEzd2bxIf52CXCYhPMKVcGVemUjYW5BHlYRfChHT9PWlvOUCAUJJW+aXWJhlpXY 51jcSI/TkfOv20XeXwhw+dXVx516LwfqRMB/PAiQz8pOw9/vzCfiLQxtt5T94d0JS3Vi 95PBuqJYktd5iFXDUuSI7AqQEZcCoHZb4voPEoIFEDJIMwC81SvMeg5Bx69SqXeZwZF2 QkwwCn68u06zVY/oKE4vsZ3N0wn36qbtOfYAVBtbXNLW95YWACcSmhwYmw+DPsV64U06 Z2Pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:content-id:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:subject:cc:to:references :in-reply-to:from:organization:dkim-signature; bh=Lz9BpuJT9ZqjBzLEQFTtycxe4tbIVPZFPrNygtaFHDI=; fh=RmbPpkHmWa19yDO2vJJHN4v6F4YRs/BfubrAZaLoLKU=; b=s/B3PtnksrDLeTz0CbV8UQ1pDuTt5LYQ2nOT0RwO30/z9S9CMRNC1AnX1Of/w52JvY smow6P4j3M+VEmL+V1NS8Repyv2GFHsJT14FpVa/R0CQnCbTEDTc3wnejkNSSETctiAg WveKFLdF5Rz4pnko1mzFSIIzPJFzwK6T4qQCg4JiQgh/gAVLPWqrrmrEleFIC1736Ys7 1RCJ1i9LcPjuEJdXQVtE+EyRVYv9KBpJAJ6IPAAGDhwqhXCXOqvxlOLgPL31QNAGokcS o1pAnWcZZpwEGuIW0PXNhZj7Q9WfvILGVP/kgfPX/4GJoqvKWl1ZcQ35w7AnZt5dhtRh EhFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QwDM5yw+; spf=pass (google.com: domain of linux-kernel+bounces-16013-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-16013-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id br9-20020a05620a460900b007815c55ec33si18299616qkb.490.2024.01.03.13.16.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 13:16:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-16013-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QwDM5yw+; spf=pass (google.com: domain of linux-kernel+bounces-16013-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-16013-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com 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 595E71C246A0 for ; Wed, 3 Jan 2024 21:16:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 174341DA4B; Wed, 3 Jan 2024 21:15:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="QwDM5yw+" X-Original-To: linux-kernel@vger.kernel.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EB2831D691 for ; Wed, 3 Jan 2024 21:15:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1704316552; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Lz9BpuJT9ZqjBzLEQFTtycxe4tbIVPZFPrNygtaFHDI=; b=QwDM5yw+VmJ8YBM7dt5dcbVZuatQF/CCRbqDR+Rz+xbvFT1Ljwn7yXQUnOu/scH2Wt5ffv UCEUK76dhKR++7KEfzL6Cf5W9/zwOR+woc0U4EL1y+Zbxabqj+LHBQ4PCboTdghZtqGN69 uf/gdVeb+8T0VX24meMydBOKaytxi5Q= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-640-1v-GWHbRM9e1RxN52-Av-w-1; Wed, 03 Jan 2024 16:15:48 -0500 X-MC-Unique: 1v-GWHbRM9e1RxN52-Av-w-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5354F3806710; Wed, 3 Jan 2024 21:15:47 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.42.28.68]) by smtp.corp.redhat.com (Postfix) with ESMTP id 576BF492BC6; Wed, 3 Jan 2024 21:15:44 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: <20240103145935.384404-1-dhowells@redhat.com> References: <20240103145935.384404-1-dhowells@redhat.com> To: Christian Brauner , Jeff Layton , Marc Dionne Cc: dhowells@redhat.com, Gao Xiang , Dominique Martinet , Steve French , Matthew Wilcox , Paulo Alcantara , Shyam Prasad N , Tom Talpey , Eric Van Hensbergen , Ilya Dryomov , linux-cachefs@redhat.com, linux-afs@lists.infradead.org, linux-cifs@vger.kernel.org, linux-nfs@vger.kernel.org, ceph-devel@vger.kernel.org, v9fs@lists.linux.dev, linux-erofs@lists.ozlabs.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 7/5] netfs: Fix proc/fs/fscache symlink to point to "netfs" not "../netfs" Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-ID: <900276.1704316543.1@warthog.procyon.org.uk> Date: Wed, 03 Jan 2024 21:15:43 +0000 Message-ID: <900277.1704316543@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.9 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787105461622998034 X-GMAIL-MSGID: 1787105461622998034 Fix the proc/fs/fscache symlink to point to "netfs" not "../netfs". Reported-by: Marc Dionne Signed-off-by: David Howells cc: Jeff Layton cc: Christian Brauner cc: linux-fsdevel@vger.kernel.org cc: linux-cachefs@redhat.com --- fs/netfs/fscache_proc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/netfs/fscache_proc.c b/fs/netfs/fscache_proc.c index ecd0d1edafaa..874d951bc390 100644 --- a/fs/netfs/fscache_proc.c +++ b/fs/netfs/fscache_proc.c @@ -16,7 +16,7 @@ */ int __init fscache_proc_init(void) { - if (!proc_symlink("fs/fscache", NULL, "../netfs")) + if (!proc_symlink("fs/fscache", NULL, "netfs")) goto error_sym; if (!proc_create_seq("fs/netfs/caches", S_IFREG | 0444, NULL,