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  linux-hardening  linux-cve-announce  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:	Mon, 21 Feb 2011 12:17:15 -0800
From:	Chuck Lever <chuck.lever@...cle.com>
To:	Konstantin Khlebnikov <khlebnikov@...nvz.org>
Cc:	linux-nfs@...r.kernel.org,
	Trond Myklebust <Trond.Myklebust@...app.com>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] NFS: account direct-io into task io accounting


On Feb 21, 2011, at 11:15 AM, Konstantin Khlebnikov wrote:

> Account complete NFS direct-io reads and writes into Task I/O Accounting.
> 
> NFS have unusual direct-io implementation,
> thus accounting in generic code does not work.
> 
> Signed-off-by: Konstantin Khlebnikov <khlebnikov@...nvz.org>
> ---
> fs/nfs/direct.c |    9 +++++++--
> 1 files changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c
> index 9943a75..bab4185 100644
> --- a/fs/nfs/direct.c
> +++ b/fs/nfs/direct.c
> @@ -45,6 +45,7 @@
> #include <linux/pagemap.h>
> #include <linux/kref.h>
> #include <linux/slab.h>
> +#include <linux/task_io_accounting_ops.h>
> 
> #include <linux/nfs_fs.h>
> #include <linux/nfs_page.h>
> @@ -939,8 +940,10 @@ ssize_t nfs_file_direct_read(struct kiocb *iocb, const struct iovec *iov,
> 		goto out;
> 
> 	retval = nfs_direct_read(iocb, iov, nr_segs, pos);
> -	if (retval > 0)
> +	if (retval > 0) {
> 		iocb->ki_pos = pos + retval;
> +		task_io_account_read(retval);
> +	}
> 
> out:
> 	return retval;
> @@ -1001,8 +1004,10 @@ ssize_t nfs_file_direct_write(struct kiocb *iocb, const struct iovec *iov,
> 
> 	retval = nfs_direct_write(iocb, iov, nr_segs, pos, count);
> 
> -	if (retval > 0)
> +	if (retval > 0) {
> 		iocb->ki_pos = pos + retval;
> +		task_io_account_write(retval);
> +	}

The async path always returns -EIOCBQUEUED.  How are those bytes accounted for?

> 
> out:
> 	return retval;

--
Chuck Lever
chuck[dot]lever[at]oracle[dot]com



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ