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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 11 Jun 2019 11:04:27 -0400
From:   Mike Snitzer <snitzer@...hat.com>
To:     Pankaj Gupta <pagupta@...hat.com>
Cc:     cohuck@...hat.com, jack@...e.cz, kvm@...r.kernel.org,
        mst@...hat.com, jasowang@...hat.com, david@...morbit.com,
        qemu-devel@...gnu.org, virtualization@...ts.linux-foundation.org,
        dm-devel@...hat.com, adilger kernel <adilger.kernel@...ger.ca>,
        zwisler@...nel.org, aarcange@...hat.com,
        dave jiang <dave.jiang@...el.com>, jstaron@...gle.com,
        linux-nvdimm@...ts.01.org,
        vishal l verma <vishal.l.verma@...el.com>, david@...hat.com,
        willy@...radead.org, hch@...radead.org, linux-acpi@...r.kernel.org,
        jmoyer@...hat.com, linux-ext4@...r.kernel.org, lenb@...nel.org,
        kilobyte@...band.pl, rdunlap@...radead.org, riel@...riel.com,
        yuval shaia <yuval.shaia@...cle.com>, stefanha@...hat.com,
        pbonzini@...hat.com, dan j williams <dan.j.williams@...el.com>,
        lcapitulino@...hat.com, kwolf@...hat.com, nilal@...hat.com,
        tytso@....edu, xiaoguangrong eric <xiaoguangrong.eric@...il.com>,
        darrick wong <darrick.wong@...cle.com>, rjw@...ysocki.net,
        linux-kernel@...r.kernel.org, linux-xfs@...r.kernel.org,
        linux-fsdevel@...r.kernel.org, imammedo@...hat.com
Subject: Re: [PATCH v11 4/7] dm: enable synchronous dax

On Tue, Jun 11 2019 at  9:10am -0400,
Pankaj Gupta <pagupta@...hat.com> wrote:

> Hi Mike,
> 
> Thanks for the review Please find my reply inline.
> 
> > 
> > dm_table_supports_dax() is called multiple times (from
> > dm_table_set_restrictions and dm_table_determine_type).  It is strange
> > to have a getter have a side-effect of being a setter too.  Overloading
> > like this could get you in trouble in the future.
> > 
> > Are you certain this is what you want?
> 
> I agree with you.
> 
> > 
> > Or would it be better to refactor dm_table_supports_dax() to take an
> > iterate_devices_fn arg and have callers pass the appropriate function?
> > Then have dm_table_set_restrictions() caller do:
> > 
> >      if (dm_table_supports_dax(t, device_synchronous, NULL))
> >                set_dax_synchronous(t->md->dax_dev);
> > 
> > (NULL arg implies dm_table_supports_dax() refactoring would take a int
> > *data pointer rather than int type).
> > 
> > Mike
> > 
> 
> I am sending below patch as per your suggestion. Does it look
> near to what you have in mind?

Yes, it does.. just one nit I noticed inlined below.

> diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
> index 350cf0451456..8d89acc8b8c2 100644
> --- a/drivers/md/dm-table.c
> +++ b/drivers/md/dm-table.c

...

> @@ -1910,8 +1919,13 @@ void dm_table_set_restrictions(struct dm_table *t, struct request_queue *q,
>         }
>         blk_queue_write_cache(q, wc, fua);
> 
> -       if (dm_table_supports_dax(t, PAGE_SIZE))
> +       if (dm_table_supports_dax(t, device_supports_dax, &page_size)) {
> +

No need for an empty newline here ^

>                 blk_queue_flag_set(QUEUE_FLAG_DAX, q);
> +               if (dm_table_supports_dax(t, device_synchronous, NULL))
> +                       set_dax_synchronous(t->md->dax_dev);
> +       }
>         else
>                 blk_queue_flag_clear(QUEUE_FLAG_DAX, q);
> 

Thanks,
Mike

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ