lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 27 Dec 2019 11:02:30 +0530
From:   Ritesh Harjani <riteshh@...ux.ibm.com>
To:     "Theodore Y. Ts'o" <tytso@....edu>, Jan Kara <jack@...e.cz>
Cc:     linux-ext4@...r.kernel.org,
        Dan Williams <dan.j.williams@...el.com>,
        "Berrocal, Eduardo" <eduardo.berrocal@...el.com>
Subject: Re: [PATCH] ext4: Optimize ext4 DIO overwrites



On 12/26/19 10:47 PM, Theodore Y. Ts'o wrote:
> On Thu, Dec 19, 2019 at 08:28:23PM +0100, Jan Kara wrote:
>>> However depending on which patch lands first one may need a
>>> re-basing. Will conflict with this-
>>> https://marc.info/?l=linux-ext4&m=157613016931238&w=2
>>
>> Yes, but the conflict is minor and trivial to resolve.
>>
> 
> Is this the correct resolution?
> 
> --- a/fs/ext4/file.c
> +++ b/fs/ext4/file.c
> @@ -447,6 +447,7 @@ static ssize_t ext4_dio_write_iter(struct kiocb *iocb, struct iov_iter *from)
>   	struct inode *inode = file_inode(iocb->ki_filp);
>   	loff_t offset = iocb->ki_pos;
>   	size_t count = iov_iter_count(from);
> +	const struct iomap_ops *iomap_ops = &ext4_iomap_ops;
>   	bool extend = false, unaligned_io = false;
>   	bool ilock_shared = true;
>   
> @@ -526,7 +527,9 @@ static ssize_t ext4_dio_write_iter(struct kiocb *iocb, struct iov_iter *from)
>   		ext4_journal_stop(handle);
>   	}
>   
> -	ret = iomap_dio_rw(iocb, from, &ext4_iomap_ops, &ext4_dio_write_ops,
> +	if (ilock_shared)
> +		iomap_ops = &ext4_iomap_overwrite_ops;
> +	ret = iomap_dio_rw(iocb, from, iomap_ops, &ext4_dio_write_ops,
>   			   is_sync_kiocb(iocb) || unaligned_io || extend);
>   
>   	if (extend)
> 
>  

Yes, this looks correct to me.

Thanks
-ritesh

Powered by blists - more mailing lists