linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.de>
To: David Howells <dhowells@redhat.com>,
	torvalds@linux-foundation.org,
	Trond Myklebust <trond.myklebust@hammerspace.com>
Cc: Lei Xue <carmark.dlut@gmail.com>,
	Dave Wysochanski <dwysocha@redhat.com>,
	David Wysochanski <dwysocha@redhat.com>,
	Carlos Maiolino <cmaiolino@redhat.com>,
	dhowells@redhat.com, Anna Schumaker <anna.schumaker@netapp.com>,
	linux-nfs@vger.kernel.org, linux-cachefs@redhat.com,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/5] cachefiles, nfs: Fixes
Date: Tue, 12 May 2020 08:38:10 +1000	[thread overview]
Message-ID: <87ftc6ayi5.fsf@notabene.neil.brown.name> (raw)
In-Reply-To: <158897619675.1119820.2203023452686054109.stgit@warthog.procyon.org.uk>

[-- Attachment #1: Type: text/plain, Size: 1390 bytes --]

On Fri, May 08 2020, David Howells wrote:

> Hi Linus, Trond, Anna,
>
> Can you pull these fixes for cachefiles and NFS's use of fscache?  Should
> they go through the NFS tree or directly upstream?  The things fixed are:

hi David,
thanks for these fscache fixes.  Here is another for your consideration.

NeilBrown


From: NeilBrown <neilb@suse.de>
Date: Tue, 12 May 2020 08:32:25 +1000
Subject: [PATCH] cachefiles: fix inverted ASSERTion.

bmap() returns a negative result precisely when a_ops->bmap is NULL.

A recent patch converted

       ASSERT(inode->i_mapping->a_ops->bmap);

to an assertion that bmap(inode, ...) returns a negative number.
This inverts the sense of the assertion.
So change it back : ASSERT(ret == 0)

Fixes: 10d83e11a582 ("cachefiles: drop direct usage of ->bmap method.")
Signed-off-by: NeilBrown <neilb@suse.de>
---
 fs/cachefiles/rdwr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/cachefiles/rdwr.c b/fs/cachefiles/rdwr.c
index 1dc97f2d6201..a4573c96660c 100644
--- a/fs/cachefiles/rdwr.c
+++ b/fs/cachefiles/rdwr.c
@@ -431,7 +431,7 @@ int cachefiles_read_or_alloc_page(struct fscache_retrieval *op,
 	block <<= shift;
 
 	ret = bmap(inode, &block);
-	ASSERT(ret < 0);
+	ASSERT(ret == 0);
 
 	_debug("%llx -> %llx",
 	       (unsigned long long) (page->index << shift),
-- 
2.26.2


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

      parent reply	other threads:[~2020-05-11 22:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-08 22:16 [PATCH 0/5] cachefiles, nfs: Fixes David Howells
2020-05-08 22:16 ` [PATCH 1/5] cachefiles: Fix corruption of the return value in cachefiles_read_or_alloc_pages() David Howells
2020-05-08 22:17 ` [PATCH 2/5] NFS: Fix fscache super_cookie index_key from changing after umount David Howells
2020-05-08 22:17 ` [PATCH 3/5] NFS: Fix fscache super_cookie allocation David Howells
2020-05-08 22:17 ` [PATCH 4/5] NFSv4: Fix fscache cookie aux_data to ensure change_attr is included David Howells
2020-05-08 22:17 ` [PATCH 5/5] cachefiles: Fix race between read_waiter and read_copier involving op->to_do David Howells
2020-05-10 13:39 ` [PATCH 0/5] cachefiles, nfs: Fixes Trond Myklebust
2020-05-10 20:35 ` David Howells
2020-05-11 22:38 ` NeilBrown [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=87ftc6ayi5.fsf@notabene.neil.brown.name \
    --to=neilb@suse.de \
    --cc=anna.schumaker@netapp.com \
    --cc=carmark.dlut@gmail.com \
    --cc=cmaiolino@redhat.com \
    --cc=dhowells@redhat.com \
    --cc=dwysocha@redhat.com \
    --cc=linux-cachefs@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=trond.myklebust@hammerspace.com \
    /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).