linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: David Howells <dhowells@redhat.com>
Cc: ceph-devel@vger.kernel.org, jlayton@kernel.org,
	linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 2/3] ceph: Uninline the data on a file opened for writing
Date: Mon, 17 Jan 2022 16:47:17 +0000	[thread overview]
Message-ID: <YeWdlR7nsBG8fYO2@casper.infradead.org> (raw)
In-Reply-To: <164243679615.2863669.15715941907688580296.stgit@warthog.procyon.org.uk>

On Mon, Jan 17, 2022 at 04:26:36PM +0000, David Howells wrote:
> +	folio = read_mapping_folio(inode->i_mapping, 0, file);
> +	if (IS_ERR(folio))
> +		goto out;

... you need to set 'err' here, right?

> +	if (folio_test_uptodate(folio))
> +		goto out_put_folio;

Er ... if (!folio_test_uptodate(folio)), perhaps?  And is it even
worth testing if read_mapping_folio() returned success?  I feel like
we should take ->readpage()'s word for it that success means the
folio is now uptodate.

> +	err = folio_lock_killable(folio);
> +	if (err < 0)
> +		goto out_put_folio;
> +
> +	if (inline_version == 1 || /* initial version, no data */
> +	    inline_version == CEPH_INLINE_NONE)
> +		goto out_unlock;
> +
> +	len = i_size_read(inode);
> +	if (len >  folio_size(folio))

extra space.  Plus, you're hardcoding 4096 below, but using folio_size()
here which is a bit weird to me.

  reply	other threads:[~2022-01-17 16:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-17 16:26 [PATCH 1/3] ceph: Make ceph_netfs_issue_op() handle inlined data (untested) David Howells
2022-01-17 16:26 ` [PATCH 2/3] ceph: Uninline the data on a file opened for writing David Howells
2022-01-17 16:47   ` Matthew Wilcox [this message]
2022-01-21 11:09     ` Jeff Layton
2022-01-17 16:59   ` David Howells
2022-01-17 17:15     ` Jeff Layton
2022-01-17 17:50     ` Matthew Wilcox
2022-01-21 14:03     ` Jeff Layton
2022-01-17 16:26 ` [PATCH 3/3] ceph: Remove some other inline-setting bits David Howells

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=YeWdlR7nsBG8fYO2@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=ceph-devel@vger.kernel.org \
    --cc=dhowells@redhat.com \
    --cc=jlayton@kernel.org \
    --cc=linux-fsdevel@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).