diff mbox

dm: writecache: fix autocommit_time option

Message ID 20180607082838.xbrgbboil4kay7zw@kili.mountain (mailing list archive)
State Accepted, archived
Delegated to: Mike Snitzer
Headers show

Commit Message

Dan Carpenter June 7, 2018, 8:28 a.m. UTC
The option is in terms of msecs so we should be using msecs_to_jiffies()
to convert it instead of the other way around.

Fixes: 1be8d9c3da01 ("dm: add writecache target")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>


--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel

Comments

Mikulas Patocka June 7, 2018, 7:19 p.m. UTC | #1
On Thu, 7 Jun 2018, Dan Carpenter wrote:

> The option is in terms of msecs so we should be using msecs_to_jiffies()
> to convert it instead of the other way around.
> 
> Fixes: 1be8d9c3da01 ("dm: add writecache target")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

OK.

Reviewed-by: Mikulas Patocka <mpatocka@redhat.com>

> diff --git a/drivers/md/dm-writecache.c b/drivers/md/dm-writecache.c
> index f2ae02f22c43..c755e8bc6bdd 100644
> --- a/drivers/md/dm-writecache.c
> +++ b/drivers/md/dm-writecache.c
> @@ -1995,7 +1995,7 @@ static int writecache_ctr(struct dm_target *ti, unsigned argc, char **argv)
>  				goto invalid_optional;
>  			if (autocommit_msecs > 3600000)
>  				goto invalid_optional;
> -			wc->autocommit_jiffies = jiffies_to_msecs(autocommit_msecs);
> +			wc->autocommit_jiffies = msecs_to_jiffies(autocommit_msecs);
>  			wc->autocommit_time_set = true;
>  		} else if (!strcasecmp(string, "fua")) {
>  			if (WC_MODE_PMEM(wc)) {
> 

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
diff mbox

Patch

diff --git a/drivers/md/dm-writecache.c b/drivers/md/dm-writecache.c
index f2ae02f22c43..c755e8bc6bdd 100644
--- a/drivers/md/dm-writecache.c
+++ b/drivers/md/dm-writecache.c
@@ -1995,7 +1995,7 @@  static int writecache_ctr(struct dm_target *ti, unsigned argc, char **argv)
 				goto invalid_optional;
 			if (autocommit_msecs > 3600000)
 				goto invalid_optional;
-			wc->autocommit_jiffies = jiffies_to_msecs(autocommit_msecs);
+			wc->autocommit_jiffies = msecs_to_jiffies(autocommit_msecs);
 			wc->autocommit_time_set = true;
 		} else if (!strcasecmp(string, "fua")) {
 			if (WC_MODE_PMEM(wc)) {