From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f181.google.com (mail-pf1-f181.google.com [209.85.210.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6B4402D058 for ; Mon, 8 Jul 2024 22:18:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720477096; cv=none; b=XZctwNuWcXUdvtScT00hxHjO690UIEpuQH6QsnuJ5yIVq+BcseVzt5hW7yIm6iSsI8w3jmFXPfEewpbBO4gCWte+vJ8DcB0m9xxD0zJmFFjVfKN+6ANU22Cw8rWtjHzCAbMsEYiDFV09skr+7hYa+4etyaefLz/d38T91NFCu+s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720477096; c=relaxed/simple; bh=DjHGuwWLZE6AYa2F05MnDHdTnkQ+OOihy3MKZKRy3Ms=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Zw+mKjILWnPH1PTu/8YWMpNGwLNciaTge3AIuMMaXSvw48Dh/n7SRQf4R+ZAZ/s4ByfXgRuXTRExieUL2Y5+mYIBTNa+lKRUjXZqSfxjxvstA8YguIvJ5OkUK72I1u4R61lLu7UoSvRr/UL8IroBtGWZ10jqTGYEsSlgcwMfdsE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com; spf=pass smtp.mailfrom=fromorbit.com; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b=VTmwHshW; arc=none smtp.client-ip=209.85.210.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b="VTmwHshW" Received: by mail-pf1-f181.google.com with SMTP id d2e1a72fcca58-70af2b1a35aso2813732b3a.1 for ; Mon, 08 Jul 2024 15:18:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fromorbit-com.20230601.gappssmtp.com; s=20230601; t=1720477095; x=1721081895; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=lynMa0qMQvKrU3+x9nFoEh4w764WLqy+q+oFFlPFpes=; b=VTmwHshWBtH5N/BwmYN5EDxmv6b8C4eJRFOBmo3IopfhfABThpiQibAzbJN51PfUSj 858G4AE6Yd3DFUdk5lhHFDhjFw1NnszoEmFCHz8r2L1dtsnwaFDmrdo/j0pm2OgHYOc3 ghmkZy8oypSng+VsgMZEAr8IZaj9hsygNb7Q+D/ZhyaeQyoB4KTbR587o7qYqcTcykhd PbbTwzh/s1544DQkjr+rQ/BMFnZIFCQUsjiTdUNuSaSI7gsnZjumxT4OeaWEyaOT8RTY 4/r7PZ44A9ind8IbFt8AdTBNvq5oQHrN09dfmP9bIW5dykTAgnmZKAc9ft7/rm72jc64 hDRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720477095; x=1721081895; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=lynMa0qMQvKrU3+x9nFoEh4w764WLqy+q+oFFlPFpes=; b=Sr08re/y2IfwVVVSn0AEscZ4Pc83huEShqbP3Yc48oufX0EtYF5TKZbVQSnIrE8YAm TVqSjYUuf2TnMK9sUO7J9c+ZbORoyve+Rw9ocWHbrJMXo558T9iBGIhzz6bwM/442fpg vt4bHcon7wc25ke9oshReZUWKNSquTYMGhVyT9JlLiKyD47GHK9JLrTcWTumGY3jVV5R gUeaWwtBCLu9PvFI9N8E6cB7SaYQqx395RtaqnvrUJ2nyx+/qZQPWPhr6QR68Lai5NGY 47ebxx+bOweKwg/0kEim93VkILkB01fsSlJvEXIzr5SRqkJ3eMXdVO/CKXj+La17Dn3N oI3Q== X-Forwarded-Encrypted: i=1; AJvYcCVg8LDQNqeqNRlaGI2qNl8MJZxsyrewCTqOy4wUNdrgJT/rF0+WgpmIDsFLxj3ds/I2xgcC4ZIpHW1OhV8IBJAX1VBKZ3lwPKdC0qgu X-Gm-Message-State: AOJu0Yyj70KSdKrB71aEPFkH73QyaDCZ5zwqqW2sVR81tMMJocEvOLlI KI+bFE5/iPuJ1ahAx8tAHda+GEHcEpeNf662dMEJx1ITFTBEHQNK7ZIkEV3WXl0= X-Google-Smtp-Source: AGHT+IEjV9bBXGFmEQTeSIY+iK7kYcB7ABn6Uk4Yy8He+5O/cUUPNO91G+kyGhhILxTgai05zaVU7Q== X-Received: by 2002:a05:6a00:1885:b0:705:9a28:aa04 with SMTP id d2e1a72fcca58-70b43650817mr1185390b3a.23.1720477094695; Mon, 08 Jul 2024 15:18:14 -0700 (PDT) Received: from dread.disaster.area (pa49-179-32-121.pa.nsw.optusnet.com.au. [49.179.32.121]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-70b4371fc2dsm406119b3a.0.2024.07.08.15.18.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jul 2024 15:18:14 -0700 (PDT) Received: from dave by dread.disaster.area with local (Exim 4.96) (envelope-from ) id 1sQwgV-008zrf-2q; Tue, 09 Jul 2024 08:18:11 +1000 Date: Tue, 9 Jul 2024 08:18:11 +1000 From: Dave Chinner To: "Pankaj Raghav (Samsung)" Cc: willy@infradead.org, chandan.babu@oracle.com, djwong@kernel.org, brauner@kernel.org, akpm@linux-foundation.org, yang@os.amperecomputing.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, john.g.garry@oracle.com, linux-fsdevel@vger.kernel.org, hare@suse.de, p.raghav@samsung.com, mcgrof@kernel.org, gost.dev@samsung.com, cl@os.amperecomputing.com, linux-xfs@vger.kernel.org, hch@lst.de, Zi Yan Subject: Re: [PATCH v9 06/10] iomap: fix iomap_dio_zero() for fs bs > system page size Message-ID: References: <20240704112320.82104-1-kernel@pankajraghav.com> <20240704112320.82104-7-kernel@pankajraghav.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240704112320.82104-7-kernel@pankajraghav.com> On Thu, Jul 04, 2024 at 11:23:16AM +0000, Pankaj Raghav (Samsung) wrote: > From: Pankaj Raghav > > iomap_dio_zero() will pad a fs block with zeroes if the direct IO size > < fs block size. iomap_dio_zero() has an implicit assumption that fs block > size < page_size. This is true for most filesystems at the moment. > > If the block size > page size, this will send the contents of the page > next to zero page(as len > PAGE_SIZE) to the underlying block device, > causing FS corruption. > > iomap is a generic infrastructure and it should not make any assumptions > about the fs block size and the page size of the system. > > Signed-off-by: Pankaj Raghav > --- > fs/iomap/buffered-io.c | 4 ++-- > fs/iomap/direct-io.c | 45 ++++++++++++++++++++++++++++++++++++------ > 2 files changed, 41 insertions(+), 8 deletions(-) Looks fine. Reviewed-by: Dave Chinner -- Dave Chinner david@fromorbit.com