From: Paulo Alcantara <pc@manguebit.com>
To: David Howells <dhowells@redhat.com>,
Steve French <stfrench@microsoft.com>
Cc: dhowells@redhat.com, Matthew Wilcox <willy@infradead.org>,
linux-cifs@vger.kernel.org, netfs@lists.linux.dev,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] cifs: Remove cifs_truncate_page() as it should be superfluous
Date: Wed, 02 Apr 2025 12:23:48 -0300 [thread overview]
Message-ID: <bac53deae60fbf5dbcb19feb403d9e9f@manguebit.com> (raw)
In-Reply-To: <559573.1743519662@warthog.procyon.org.uk>
David Howells <dhowells@redhat.com> writes:
> The calls to cifs_truncate_page() should be superfluous as the places that
> call it also call truncate_setsize() or cifs_setsize() and therefore
> truncate_pagecache() which should also clear the tail part of the folio
> containing the EOF marker.
>
> Further, smb3_simple_falloc() calls both cifs_setsize() and
> truncate_setsize() in addition to cifs_truncate_page().
>
> Remove the superfluous calls.
>
> This gets rid of another function referring to struct page.
>
> [Should cifs_setsize() also set inode->i_blocks?]
I don't think that's necessary as the current inode will be marked for
revalidation (e.g. cifsInodeInfo::time is set to 0), so next call to
cifs_fattr_to_inode() will update inode->i_blocks. If it isn't being
updated, then I'm missing something else.
> Signed-off-by: David Howells <dhowells@redhat.com>
> cc: Steve French <stfrench@microsoft.com>
> cc: Paulo Alcantara (Red Hat) <pc@manguebit.com>
> cc: Matthew Wilcox <willy@infradead.org>
> cc: linux-cifs@vger.kernel.org
> cc: netfs@lists.linux.dev
> cc: linux-fsdevel@vger.kernel.org
> ---
> fs/smb/client/cifsfs.h | 1 -
> fs/smb/client/inode.c | 19 -------------------
> fs/smb/client/smb2ops.c | 2 --
> 3 files changed, 22 deletions(-)
Looks good,
Reviewed-by: Paulo Alcantara (Red Hat) <pc@manguebit.com>
prev parent reply other threads:[~2025-04-02 15:33 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-01 15:01 [PATCH] cifs: Remove cifs_truncate_page() as it should be superfluous David Howells
2025-04-02 15:23 ` Paulo Alcantara [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bac53deae60fbf5dbcb19feb403d9e9f@manguebit.com \
--to=pc@manguebit.com \
--cc=dhowells@redhat.com \
--cc=linux-cifs@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netfs@lists.linux.dev \
--cc=stfrench@microsoft.com \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox