Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp1340094pxu; Thu, 8 Oct 2020 09:07:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJymxLray62JLymkcAHVFC5vkCxp3UAWI3NcG57Aovyn0V853JKawycJNk4UaarNbPWHq+xY X-Received: by 2002:a05:6402:1004:: with SMTP id c4mr2473618edu.149.1602173225109; Thu, 08 Oct 2020 09:07:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602173225; cv=none; d=google.com; s=arc-20160816; b=IJBQzmwmnHlVtknufqnencJldYQGcIEShv/8QnP+MVKlDHxmHXsLPCx61SVFAnGUM8 KDLBEI4rahYZ8iVSJbywWd7VbIljc79/a0JxbwIDBY0pmacIWaUMrggMnUBF1yLxTDJT rfWYXJh2o9bg80LkqcPBNjVMJjvoJ35Y08Ya99WtDMiIDvBXrcCFCMXon/uEdcEEGcez VdBJ6kAg64IIaujCZWIBaR3Jq5d/kszdBohTGUknyTX29PVGEHi7X3vGd2Y0Xp+La1V4 6BoyQ3nY1blcSb95fYFd1oIZ+TVMGgs48k4lDdcY+hJU/A/6K6bOiRZoRaKSVk2Ga5Kd cVew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=gQRMOh28nkWnqlrQPSyV0f59YtqaGyD8KoooDvubGOk=; b=b8mZeIcNQI0lxGZrQbkwSCBkq7Z3S/jYJz9oVZyNjy0jH5eSXKVKnZjADyA9BFrVrS z8xZR9fveqPe6EA9g3xO9458ACyGpZmjbM2xVOeA0oGbZhFLseJpK+RWLNoJ9zrfsqDJ 0ZqO4c0a+4MTKbxr3/IbTOCdpJi2EcIUO9E3OqfQFvry/UDcZ9AQXUfoP19X0lq4tl9M wQnzj644W0cLWl9HbqMFHvgvzkGOm4xIX6RmIPjN+XL0q8hRln0g4ckUCatV/QmYQUE9 3DeqUKmKYo9EMfSwPSzCmNKG+EhdSbyc6WmwdQ7BNWyGgEPzP/vT/W6MFoDol/HirKpg PGqQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i21si4225563edg.487.2020.10.08.09.06.33; Thu, 08 Oct 2020 09:07:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728323AbgJHQE0 (ORCPT + 99 others); Thu, 8 Oct 2020 12:04:26 -0400 Received: from mx2.suse.de ([195.135.220.15]:44214 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726875AbgJHQE0 (ORCPT ); Thu, 8 Oct 2020 12:04:26 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 064D4AC85; Thu, 8 Oct 2020 16:04:25 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id A3C181E1305; Thu, 8 Oct 2020 18:04:24 +0200 (CEST) Date: Thu, 8 Oct 2020 18:04:24 +0200 From: Jan Kara To: Ritesh Harjani Cc: linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, tytso@mit.edu, jack@suse.cz, anju@linux.vnet.ibm.com, "Aneesh Kumar K . V" Subject: Re: [PATCH 1/1] ext4: Fix bs < ps issue reported with dioread_nolock mount opt Message-ID: <20201008160424.GA14976@quack2.suse.cz> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Thu 08-10-20 20:32:48, Ritesh Harjani wrote: > left shifting m_lblk by blkbits was causing value overflow and hence > it was not able to convert unwritten to written extent. > So, make sure we typecast it to loff_t before do left shift operation. > Also in func ext4_convert_unwritten_io_end_vec(), make sure to initialize > ret variable to avoid accidentally returning an uninitialized ret. > > This patch fixes the issue reported in ext4 for bs < ps with > dioread_nolock mount option. > > Fixes: c8cc88163f40df39e50c ("ext4: Add support for blocksize < pagesize in dioread_nolock") > Reported-by: Aneesh Kumar K.V > Signed-off-by: Ritesh Harjani Ah, good spotting! The patch looks good. You can add: Reviewed-by: Jan Kara Honza > --- > fs/ext4/extents.c | 2 +- > fs/ext4/inode.c | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c > index a0481582187a..32d610cc896d 100644 > --- a/fs/ext4/extents.c > +++ b/fs/ext4/extents.c > @@ -4769,7 +4769,7 @@ int ext4_convert_unwritten_extents(handle_t *handle, struct inode *inode, > > int ext4_convert_unwritten_io_end_vec(handle_t *handle, ext4_io_end_t *io_end) > { > - int ret, err = 0; > + int ret = 0, err = 0; > struct ext4_io_end_vec *io_end_vec; > > /* > diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c > index bf596467c234..3021235deaa1 100644 > --- a/fs/ext4/inode.c > +++ b/fs/ext4/inode.c > @@ -2254,7 +2254,7 @@ static int mpage_process_page(struct mpage_da_data *mpd, struct page *page, > err = PTR_ERR(io_end_vec); > goto out; > } > - io_end_vec->offset = mpd->map.m_lblk << blkbits; > + io_end_vec->offset = (loff_t)mpd->map.m_lblk << blkbits; > } > *map_bh = true; > goto out; > -- > 2.26.2 > -- Jan Kara SUSE Labs, CR