From: Eric Sandeen <sandeen@redhat.com>
To: Carlos Maiolino <cmaiolino@redhat.com>, linux-fsdevel@vger.kernel.org
Cc: hch@lst.de, david@fromorbit.com
Subject: Re: [PATCH 1/2] fs: Replace direct ->bmap calls by bmap()
Date: Wed, 5 Sep 2018 09:23:26 -0500 [thread overview]
Message-ID: <b7bfbb00-a4f7-5131-2085-0311cb2d4b10@redhat.com> (raw)
In-Reply-To: <20180905135748.30098-2-cmaiolino@redhat.com>
On 9/5/18 8:57 AM, Carlos Maiolino wrote:
> Prepare the field to use ->fiemap for FIBMAP ioctl
>
> Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
> ---
> fs/cachefiles/rdwr.c | 5 ++---
> fs/ecryptfs/mmap.c | 5 ++---
> fs/ioctl.c | 14 ++++++++------
> 3 files changed, 12 insertions(+), 12 deletions(-)
>
> diff --git a/fs/cachefiles/rdwr.c b/fs/cachefiles/rdwr.c
> index 40f7595aad10..186e203d64a7 100644
> --- a/fs/cachefiles/rdwr.c
> +++ b/fs/cachefiles/rdwr.c
> @@ -435,7 +435,7 @@ int cachefiles_read_or_alloc_page(struct fscache_retrieval *op,
> block0 = page->index;
> block0 <<= shift;
>
> - block = inode->i_mapping->a_ops->bmap(inode->i_mapping, block0);
> + block = bmap(inode, block0);
Prior to this there's an ASSERT that inode->i_mapping->a_ops->bmap
exists. Should that stay, if the goal is to move all ->bmap use out
of calling code? OTOH, what will this code do if bmap() finds that there
is no ->bmap present and returns 0?
> _debug("%llx -> %llx",
> (unsigned long long) block0,
> (unsigned long long) block);
> @@ -737,8 +737,7 @@ int cachefiles_read_or_alloc_pages(struct fscache_retrieval *op,
> block0 = page->index;
> block0 <<= shift;
>
> - block = inode->i_mapping->a_ops->bmap(inode->i_mapping,
> - block0);
> + block = bmap(inode, block0);
> _debug("%llx -> %llx",
> (unsigned long long) block0,
> (unsigned long long) block);
> diff --git a/fs/ecryptfs/mmap.c b/fs/ecryptfs/mmap.c
> index cdf358b209d9..16626fce5754 100644
> --- a/fs/ecryptfs/mmap.c
> +++ b/fs/ecryptfs/mmap.c
> @@ -544,9 +544,8 @@ static sector_t ecryptfs_bmap(struct address_space *mapping, sector_t block)
>
> inode = (struct inode *)mapping->host;
> lower_inode = ecryptfs_inode_to_lower(inode);
> - if (lower_inode->i_mapping->a_ops->bmap)
> - rc = lower_inode->i_mapping->a_ops->bmap(lower_inode->i_mapping,
> - block);
> +
> + rc = bmap(lower_inode, block);
> return rc;
> }
>
> diff --git a/fs/ioctl.c b/fs/ioctl.c
> index 3212c29235ce..413585d58415 100644
> --- a/fs/ioctl.c
> +++ b/fs/ioctl.c
> @@ -53,19 +53,21 @@ EXPORT_SYMBOL(vfs_ioctl);
>
> static int ioctl_fibmap(struct file *filp, int __user *p)
> {
> - struct address_space *mapping = filp->f_mapping;
> + struct inode *inode = filp->f_inode;
> int res, block;
>
> - /* do we support this mess? */
> - if (!mapping->a_ops->bmap)
> - return -EINVAL;
> if (!capable(CAP_SYS_RAWIO))
> return -EPERM;
> res = get_user(block, p);
> if (res)
> return res;
> - res = mapping->a_ops->bmap(mapping, block);
> - return put_user(res, p);
> +
> + res = bmap(inode, block);
> +
> + if (res)
> + return put_user(res, p);
> + else
> + return -EINVAL;
So now mapping a hole will return -EINVAL? I don't think that change
in behavior is ok.
-Eric
> }
>
> /**
>
next prev parent reply other threads:[~2018-09-05 18:53 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-05 13:57 [PATCH RFC 0/2] ->bmap interface retirement Carlos Maiolino
2018-09-05 13:57 ` [PATCH 1/2] fs: Replace direct ->bmap calls by bmap() Carlos Maiolino
2018-09-05 14:23 ` Eric Sandeen [this message]
2018-09-05 18:55 ` Christoph Hellwig
2018-09-06 8:04 ` Carlos Maiolino
2018-09-06 8:03 ` Carlos Maiolino
2018-09-05 13:57 ` [PATCH 2/2] Use fiemap internal infra-structure to handle FIBMAP Carlos Maiolino
2018-09-05 14:31 ` Matthew Wilcox
2018-09-05 18:56 ` Christoph Hellwig
2018-09-06 8:31 ` Carlos Maiolino
2018-09-10 7:50 ` Christoph Hellwig
2018-09-10 10:31 ` Carlos Maiolino
2018-09-26 13:34 ` Carlos Maiolino
2018-09-06 8:18 ` Carlos Maiolino
2018-09-05 14:40 ` Eric Sandeen
2018-09-06 8:12 ` Carlos Maiolino
2018-09-06 15:53 ` Eric Sandeen
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=b7bfbb00-a4f7-5131-2085-0311cb2d4b10@redhat.com \
--to=sandeen@redhat.com \
--cc=cmaiolino@redhat.com \
--cc=david@fromorbit.com \
--cc=hch@lst.de \
--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).