From: Christoph Hellwig Subject: Re: [PATCH 02/11] ext4: Allow unaligned unlocked DAX IO Date: Wed, 2 Nov 2016 07:27:46 -0700 Message-ID: <20161102142746.GA18387@infradead.org> References: <1478034381-19037-1-git-send-email-jack@suse.cz> <1478034381-19037-3-git-send-email-jack@suse.cz> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Ted Tso , linux-ext4-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Dave Chinner , linux-nvdimm-y27Ovi1pjclAfugRpC6u6w@public.gmane.org To: Jan Kara Return-path: Content-Disposition: inline In-Reply-To: <1478034381-19037-3-git-send-email-jack-AlSwsSmVLrQ@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-nvdimm-bounces-hn68Rpc1hR1g9hUCZPvPmw@public.gmane.org Sender: "Linux-nvdimm" List-Id: linux-ext4.vger.kernel.org On Tue, Nov 01, 2016 at 10:06:12PM +0100, Jan Kara wrote: > Currently we don't allow unaligned writes without inode_lock. This is > because zeroing of partial blocks could cause data corruption for racing > unaligned writes to the same block. However DAX handles zeroing during > block allocation and thus zeroing of partial blocks cannot race. Allow > DAX unaligned IO to run without inode_lock. DAX writes should always take the inode lock. Without that you break the expectations of existing applications that did not specify O_DIRECT.