[Devel,RHEL7,COMMIT] fuse: no mtime flush on fdatasync

Submitted by Konstantin Khorenko on Dec. 2, 2016, 2:35 p.m.

Details

Message ID 201612021435.uB2EZ3p8022982@finist_cl7.x64_64.work.ct
State New
Series "fuse: no mtime flush on fdatasync"
Headers show

Commit Message

Konstantin Khorenko Dec. 2, 2016, 2:35 p.m.
The commit is pushed to "branch-rh7-3.10.0-327.36.1.vz7.20.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-327.36.1.vz7.20.9
------>
commit 2b39263eeee33196c731257c173f7be35d4bd8a4
Author: Maxim Patlasov <mpatlasov@virtuozzo.com>
Date:   Fri Dec 2 18:34:57 2016 +0400

    fuse: no mtime flush on fdatasync
    
    fuse_fsync_common() may skip fuse_flush_mtime() if datasync=1 because
    mtime is pure metadata and the content of file doesn't depend on it.
    
    https://jira.sw.ru/browse/PSBM-55919
    
    Signed-off-by: Maxim Patlasov <mpatlasov@virtuozzo.com>
    Acked-by: Dmitry Monakhov <dmonakhov@openvz.org>
---
 fs/fuse/file.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index d11125f..52bca91 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -691,8 +691,8 @@  int fuse_fsync_common(struct file *file, loff_t start, loff_t end,
 	if (err)
 		goto out;
 
-	if (test_bit(FUSE_I_MTIME_UPDATED,
-		     &get_fuse_inode(inode)->state)) {
+	if (!datasync && test_bit(FUSE_I_MTIME_UPDATED,
+				  &get_fuse_inode(inode)->state)) {
 		err = fuse_flush_mtime(file, false);
 		if (err)
 			goto out;

Comments

Konstantin Khorenko Dec. 7, 2016, 3:24 p.m.
Please consider to RK.

--
Best regards,

Konstantin Khorenko,
Virtuozzo Linux Kernel Team

On 12/02/2016 05:35 PM, Konstantin Khorenko wrote:
> The commit is pushed to "branch-rh7-3.10.0-327.36.1.vz7.20.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
> after rh7-3.10.0-327.36.1.vz7.20.9
> ------>
> commit 2b39263eeee33196c731257c173f7be35d4bd8a4
> Author: Maxim Patlasov <mpatlasov@virtuozzo.com>
> Date:   Fri Dec 2 18:34:57 2016 +0400
>
>     fuse: no mtime flush on fdatasync
>
>     fuse_fsync_common() may skip fuse_flush_mtime() if datasync=1 because
>     mtime is pure metadata and the content of file doesn't depend on it.
>
>     https://jira.sw.ru/browse/PSBM-55919
>
>     Signed-off-by: Maxim Patlasov <mpatlasov@virtuozzo.com>
>     Acked-by: Dmitry Monakhov <dmonakhov@openvz.org>
> ---
>  fs/fuse/file.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/fs/fuse/file.c b/fs/fuse/file.c
> index d11125f..52bca91 100644
> --- a/fs/fuse/file.c
> +++ b/fs/fuse/file.c
> @@ -691,8 +691,8 @@ int fuse_fsync_common(struct file *file, loff_t start, loff_t end,
>  	if (err)
>  		goto out;
>
> -	if (test_bit(FUSE_I_MTIME_UPDATED,
> -		     &get_fuse_inode(inode)->state)) {
> +	if (!datasync && test_bit(FUSE_I_MTIME_UPDATED,
> +				  &get_fuse_inode(inode)->state)) {
>  		err = fuse_flush_mtime(file, false);
>  		if (err)
>  			goto out;
> .
>
Konstantin Khorenko Dec. 7, 2016, 3:25 p.m.
Consider to port to PCS6.

--
Best regards,

Konstantin Khorenko,
Virtuozzo Linux Kernel Team

On 12/02/2016 05:35 PM, Konstantin Khorenko wrote:
> The commit is pushed to "branch-rh7-3.10.0-327.36.1.vz7.20.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
> after rh7-3.10.0-327.36.1.vz7.20.9
> ------>
> commit 2b39263eeee33196c731257c173f7be35d4bd8a4
> Author: Maxim Patlasov <mpatlasov@virtuozzo.com>
> Date:   Fri Dec 2 18:34:57 2016 +0400
>
>     fuse: no mtime flush on fdatasync
>
>     fuse_fsync_common() may skip fuse_flush_mtime() if datasync=1 because
>     mtime is pure metadata and the content of file doesn't depend on it.
>
>     https://jira.sw.ru/browse/PSBM-55919
>
>     Signed-off-by: Maxim Patlasov <mpatlasov@virtuozzo.com>
>     Acked-by: Dmitry Monakhov <dmonakhov@openvz.org>
> ---
>  fs/fuse/file.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/fs/fuse/file.c b/fs/fuse/file.c
> index d11125f..52bca91 100644
> --- a/fs/fuse/file.c
> +++ b/fs/fuse/file.c
> @@ -691,8 +691,8 @@ int fuse_fsync_common(struct file *file, loff_t start, loff_t end,
>  	if (err)
>  		goto out;
>
> -	if (test_bit(FUSE_I_MTIME_UPDATED,
> -		     &get_fuse_inode(inode)->state)) {
> +	if (!datasync && test_bit(FUSE_I_MTIME_UPDATED,
> +				  &get_fuse_inode(inode)->state)) {
>  		err = fuse_flush_mtime(file, false);
>  		if (err)
>  			goto out;
> .
>