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:   Thu, 18 May 2017 08:30:36 +0000
From:   "Dilger, Andreas" <andreas.dilger@...el.com>
To:     Davidlohr Bueso <dave@...olabs.net>
CC:     "mingo@...nel.org" <mingo@...nel.org>,
        "peterz@...radead.org" <peterz@...radead.org>,
        "akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
        "jack@...e.cz" <jack@...e.cz>,
        "kirill.shutemov@...ux.intel.com" <kirill.shutemov@...ux.intel.com>,
        "ldufour@...ux.vnet.ibm.com" <ldufour@...ux.vnet.ibm.com>,
        "mhocko@...e.com" <mhocko@...e.com>,
        "mgorman@...hsingularity.net" <mgorman@...hsingularity.net>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "Drokin, Oleg" <oleg.drokin@...el.com>,
        "jsimmons@...radead.org" <jsimmons@...radead.org>,
        "lustre-devel@...ts.lustre.org" <lustre-devel@...ts.lustre.org>,
        "Davidlohr Bueso" <dbueso@...e.de>
Subject: Re: [PATCH 6/6] staging/lustre: Use generic range rwlock

On May 15, 2017, at 11:07, Davidlohr Bueso <dave@...olabs.net> wrote:
> 
> This replaces the in-house version, which is also derived
> from Jan's interval tree implementation.
> 
> Cc: oleg.drokin@...el.com
> Cc: andreas.dilger@...el.com
> Cc: jsimmons@...radead.org
> Cc: lustre-devel@...ts.lustre.org
> Signed-off-by: Davidlohr Bueso <dbueso@...e.de>

Repeating my request that the whole patch series should be CC'd to the linux-fsdevel list,
since I only got this last patch and this makes it difficult to review the whole series.

> ---
> diff --git a/drivers/staging/lustre/lustre/llite/file.c b/drivers/staging/lustre/lustre/llite/file.c
> index 67c4b9cc6e75..bd020bdaf85d 100644
> --- a/drivers/staging/lustre/lustre/llite/file.c
> +++ b/drivers/staging/lustre/lustre/llite/file.c
> @@ -1083,10 +1083,10 @@ ll_file_io_generic(const struct lu_env *env, struct vvp_io_args *args,
> 		if (((iot == CIT_WRITE) ||
> 		     (iot == CIT_READ && (file->f_flags & O_DIRECT))) &&
> 		    !(vio->vui_fd->fd_flags & LL_FILE_GROUP_LOCKED)) {
> -			CDEBUG(D_VFSTRACE, "Range lock [%llu, %llu]\n",
> -			       range.rl_node.in_extent.start,
> -			       range.rl_node.in_extent.end);
> -			rc = range_lock(&lli->lli_write_tree, &range);
> +			CDEBUG(D_VFSTRACE, "Range lock [%lu, %lu]\n",
> +			       range.node.start,
> +			       range.node.last);
> +			rc = range_write_lock_interruptible(&lli->lli_write_tree, &range);
> 			if (rc < 0)
> 				goto out;
> 
> @@ -1096,10 +1096,10 @@ ll_file_io_generic(const struct lu_env *env, struct vvp_io_args *args,
> 		rc = cl_io_loop(env, io);
> 		ll_cl_remove(file, env);
> 		if (range_locked) {
> -			CDEBUG(D_VFSTRACE, "Range unlock [%llu, %llu]\n",
> -			       range.rl_node.in_extent.start,
> -			       range.rl_node.in_extent.end);
> -			range_unlock(&lli->lli_write_tree, &range);
> +			CDEBUG(D_VFSTRACE, "Range unlock [%lu, %lu]\n",
> +			       range.node.start,
> +			       range.node.last);
> +			range_write_unlock(&lli->lli_write_tree, &range);
> 		}
> 	} else {
> 		/* cl_io_rw_init() handled IO */

I'm not against this patch, but it does expose an implementation difference between the
Lustre version of this code and the in-tree version.  Preferred kernel coding style is to
have a struct-unique prefix for struct members (e.g. using "rl_" for struct range_lock,
using "in_" for struct interval_tree_node).  That allows tags to work properly, instead
of trying to locate generic struct names like "start", "node" etc.

In an unexpected twist of fate, the Lustre version of this code is following preferred
coding style and the in-tree (interval_tree) and submitted (range_rwlock) code does not.

Cheers, Andreas






Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ