diff mbox

[1/3] ceph: remove useless page->mapping check in writepage_nounlock()

Message ID 20170523095439.63347-1-zyan@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Yan, Zheng May 23, 2017, 9:54 a.m. UTC
Callers of writepage_nounlock() have already ensured non-null
page->mapping.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
---
 fs/ceph/addr.c | 4 ----
 1 file changed, 4 deletions(-)

Comments

Jeff Layton May 23, 2017, 10:31 a.m. UTC | #1
On Tue, 2017-05-23 at 17:54 +0800, Yan, Zheng wrote:
> Callers of writepage_nounlock() have already ensured non-null
> page->mapping.
> 
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
> ---
>  fs/ceph/addr.c | 4 ----
>  1 file changed, 4 deletions(-)
> 
> diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
> index f49d6630..ff25239 100644
> --- a/fs/ceph/addr.c
> +++ b/fs/ceph/addr.c
> @@ -534,10 +534,6 @@ static int writepage_nounlock(struct page *page, struct writeback_control *wbc)
>  
>  	dout("writepage %p idx %lu\n", page, page->index);
>  
> -	if (!page->mapping || !page->mapping->host) {
> -		dout("writepage %p - no mapping\n", page);
> -		return -EFAULT;
> -	}
>  	inode = page->mapping->host;
>  	ci = ceph_inode(inode);
>  	fsc = ceph_inode_to_client(inode);

Reviewed-by: Jeff Layton <jlayton@redhat.com>
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
index f49d6630..ff25239 100644
--- a/fs/ceph/addr.c
+++ b/fs/ceph/addr.c
@@ -534,10 +534,6 @@  static int writepage_nounlock(struct page *page, struct writeback_control *wbc)
 
 	dout("writepage %p idx %lu\n", page, page->index);
 
-	if (!page->mapping || !page->mapping->host) {
-		dout("writepage %p - no mapping\n", page);
-		return -EFAULT;
-	}
 	inode = page->mapping->host;
 	ci = ceph_inode(inode);
 	fsc = ceph_inode_to_client(inode);