[2/9] block: BLK_PERM_WRITE includes ..._UNCHANGED

Message ID 20180416165849.28864-3-mreitz@redhat.com
State New
Headers show
Series
  • block: Add COR filter driver
Related show

Commit Message

Max Reitz April 16, 2018, 4:58 p.m.
Currently we never actually check whether the WRITE_UNCHANGED
permission has been taken for unchanging writes.  But the one check that
is commented out checks both WRITE and WRITE_UNCHANGED; and considering
that WRITE_UNCHANGED is already documented as being weaker then WRITE,
we should probably explicitly document WRITE to include WRITE_UNCHANGED.

Signed-off-by: Max Reitz <mreitz@redhat.com>
---
 include/block/block.h | 3 +++
 1 file changed, 3 insertions(+)

Comments

Stefan Hajnoczi April 20, 2018, 8:32 a.m. | #1
On Mon, Apr 16, 2018 at 06:58:42PM +0200, Max Reitz wrote:
> Currently we never actually check whether the WRITE_UNCHANGED
> permission has been taken for unchanging writes.  But the one check that
> is commented out checks both WRITE and WRITE_UNCHANGED; and considering
> that WRITE_UNCHANGED is already documented as being weaker then WRITE,

s/then/than/

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Alberto Garcia April 20, 2018, 12:04 p.m. | #2
On Mon 16 Apr 2018 06:58:42 PM CEST, Max Reitz wrote:
> Currently we never actually check whether the WRITE_UNCHANGED
> permission has been taken for unchanging writes.  But the one check that
> is commented out checks both WRITE and WRITE_UNCHANGED; and considering
> that WRITE_UNCHANGED is already documented as being weaker then WRITE,
> we should probably explicitly document WRITE to include WRITE_UNCHANGED.
>
> Signed-off-by: Max Reitz <mreitz@redhat.com>

Reviewed-by: Alberto Garcia <berto@igalia.com>

s/then/than/ as Stefan mentioned.

Berto
Max Reitz April 20, 2018, 1:22 p.m. | #3
On 2018-04-20 14:04, Alberto Garcia wrote:
> On Mon 16 Apr 2018 06:58:42 PM CEST, Max Reitz wrote:
>> Currently we never actually check whether the WRITE_UNCHANGED
>> permission has been taken for unchanging writes.  But the one check that
>> is commented out checks both WRITE and WRITE_UNCHANGED; and considering
>> that WRITE_UNCHANGED is already documented as being weaker then WRITE,
>> we should probably explicitly document WRITE to include WRITE_UNCHANGED.
>>
>> Signed-off-by: Max Reitz <mreitz@redhat.com>
> 
> Reviewed-by: Alberto Garcia <berto@igalia.com>
> 
> s/then/than/ as Stefan mentioned.

Yep, will fix.


Thanks for reviewing!

Max

Patch

diff --git a/include/block/block.h b/include/block/block.h
index cdec3639a3..397b5e8d44 100644
--- a/include/block/block.h
+++ b/include/block/block.h
@@ -205,6 +205,9 @@  enum {
      * This permission (which is weaker than BLK_PERM_WRITE) is both enough and
      * required for writes to the block node when the caller promises that
      * the visible disk content doesn't change.
+     *
+     * As the BLK_PERM_WRITE permission is strictly stronger, either is
+     * sufficient to perform an unchanging write.
      */
     BLK_PERM_WRITE_UNCHANGED    = 0x04,