Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3482819pxv; Mon, 26 Jul 2021 05:18:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxx//YarIzfTE6fN72Blsb+iHbeQ90CeD9x//ckvsu/zR9jvwemMDFFAAaIHMEG2x0L78mW X-Received: by 2002:a17:907:1de7:: with SMTP id og39mr16702299ejc.221.1627301937858; Mon, 26 Jul 2021 05:18:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627301937; cv=none; d=google.com; s=arc-20160816; b=TwI9FelE4h/j0EbkpRdjF3vef8XKvutNxH+diufl4BwotuBn/pOgJjNzGQ0fxmE+jx ylmlLSxSHAj3ZXmvj6PKUp18s308eb99YOFVunWu1xyMFyUGgSHr3CvVpLvHJ1GDCDJd +pNw069CEXGsqRIHNgyWU1b88UVX1/aYy4AKAUdYuZRir4/kjitXiUH0satBRLLYMZ5U NR6+UkgyzsyPa8SDD5Zvv4nH3+vKKTsC7TOGcjFaJB5yYY8w/GXinKu211L/v51i7bvU x09TmdNGHkgYfgj7ZY4Evv9oA7GCZlHN5u5Yw9UDHkECrW+GpT3UFMpL3vOSFLpcMlIE f4Lw== 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=/SRLOi4SaCbqCkm4kXhhONo/rPjscSZ7Ki3mZanEcoY=; b=fAVcy7BjYJBlsMLImZlI6yWYMyPZpMbMRSDbx9ep377/+MUVupCVv+m7SdEZCucCp3 +0i6GiKyecD29XYY6DdqFFje8YqWL1mTcgOqFm+td9EyjtZXAHVtFu7N64iYfPOhxPri Qc9Wv9Nn3w9SL+MvG5l3IU6jby8IrVb9OugQV+L2KjOvki9NGw71b01vqpMAikyDf3g/ gz/fMjKU6WQhlEYEGs9sPZsz/nkiFR2PxjXdzZWWp6yXpBOPKYQ+6CmG16ZqrLYF7/GO JZOo+oda2gKBeFx/KB3Kl5komRaW/X/+CYc4r0JAcuBDbYtqf1+MTrZZAVljaEBlYonR 4oVQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 21si30133252ejz.246.2021.07.26.05.18.33; Mon, 26 Jul 2021 05:18:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233871AbhGZLgh (ORCPT + 99 others); Mon, 26 Jul 2021 07:36:37 -0400 Received: from verein.lst.de ([213.95.11.211]:44953 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233713AbhGZLgg (ORCPT ); Mon, 26 Jul 2021 07:36:36 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id DA9AA67373; Mon, 26 Jul 2021 14:17:02 +0200 (CEST) Date: Mon, 26 Jul 2021 14:17:02 +0200 From: Christoph Hellwig To: Andreas Gruenbacher Cc: Gao Xiang , Christoph Hellwig , "Darrick J . Wong" , Matthew Wilcox , Huang Jianan , linux-erofs@lists.ozlabs.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Andreas Gruenbacher Subject: Re: [PATCH v7] iomap: make inline data support more flexible Message-ID: <20210726121702.GA528@lst.de> References: <20210723174131.180813-1-hsiangkao@linux.alibaba.com> <20210725221639.426565-1-agruenba@redhat.com> <20210726110611.459173-1-agruenba@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210726110611.459173-1-agruenba@redhat.com> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > Subject: iomap: Support tail packing I can't say I like this "tail packing" language here when we have the perfectly fine inline wording. Same for various comments in the actual code. > + /* inline and tail-packed data must start page aligned in the file */ > + if (WARN_ON_ONCE(offset_in_page(iomap->offset))) > + return -EIO; > + if (WARN_ON_ONCE(size > PAGE_SIZE - offset_in_page(iomap->inline_data))) > + return -EIO; Why can't we use iomap_inline_data_size_valid here? That is how can size be different from iomap->legth? Shouldn't the offset_in_page also go into iomap_inline_data_size_valid, which should probably be called iomap_inline_data_valid then? > if (iomap->type == IOMAP_INLINE) { > + int ret = iomap_read_inline_data(inode, page, iomap); > + return ret ?: PAGE_SIZE; The ?: expression without the first leg is really confuing. Especially if a good old if is much more readable here. int ret = iomap_read_inline_data(inode, page, iomap); if (ret) return ret; return PAGE_SIZE; > + copied = copy_from_iter(iomap_inline_data(iomap, pos), length, iter); > + copied = copy_to_iter(iomap_inline_data(iomap, pos), length, iter); Pleae avoid the overly long lines.