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:	Wed, 11 Mar 2015 18:17:18 +0800
From:	"Yan, Zheng" <ukernel@...il.com>
To:	Nicholas Mc Guire <hofrat@...dl.org>
Cc:	Yan Zheng <zyan@...hat.com>, Sage Weil <sage@...hat.com>,
	ceph-devel <ceph-devel@...r.kernel.org>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] ceph: match wait_for_completion_timeout return type

On Tue, Mar 10, 2015 at 11:18 PM, Nicholas Mc Guire <hofrat@...dl.org> wrote:
> return type of wait_for_completion_timeout is unsigned long not int. An
> appropriately named unsigned long is added and the assignment fixed up.
>
> Signed-off-by: Nicholas Mc Guire <hofrat@...dl.org>
> ---
>
> This was only compile tested for x86_64_defconfig + CONFIG_CEPH_FS=m
>
> Patch is against 4.0-rc2 linux-next (localversion-next is -next-20150306)
>
>  fs/ceph/dir.c |    7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c
> index 83e9976..4bee6b7 100644
> --- a/fs/ceph/dir.c
> +++ b/fs/ceph/dir.c
> @@ -1218,6 +1218,7 @@ static int ceph_dir_fsync(struct file *file, loff_t start, loff_t end,
>         struct ceph_mds_request *req;
>         u64 last_tid;
>         int ret = 0;
> +       unsigned long time_left;
>
>         dout("dir_fsync %p\n", inode);
>         ret = filemap_write_and_wait_range(inode->i_mapping, start, end);
> @@ -1240,11 +1241,11 @@ static int ceph_dir_fsync(struct file *file, loff_t start, loff_t end,
>                 dout("dir_fsync %p wait on tid %llu (until %llu)\n",
>                      inode, req->r_tid, last_tid);
>                 if (req->r_timeout) {
> -                       ret = wait_for_completion_timeout(
> +                       time_left = wait_for_completion_timeout(
>                                 &req->r_safe_completion, req->r_timeout);
> -                       if (ret > 0)
> +                       if (time_left > 0)
>                                 ret = 0;
> -                       else if (ret == 0)
> +                       else if (!time_left)
>                                 ret = -EIO;  /* timed out */
>                 } else {
>                         wait_for_completion(&req->r_safe_completion);

There are lots of similar codes in kernel. I don't think this code
causes problem in reality

> --
> 1.7.10.4
>
> --
> 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/
--
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