All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nikolay Borisov <nborisov@suse.com>
To: dsterba@suse.cz, David Sterba <dsterba@suse.com>,
	linux-btrfs@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] btrfs: add missing check for nocow and compression inode flags
Date: Fri, 10 Jul 2020 17:55:27 +0300	[thread overview]
Message-ID: <fe45989f-1609-0afa-bc57-6419e4010f1b@suse.com> (raw)
In-Reply-To: <20200710133413.GB3703@twin.jikos.cz>



On 10.07.20 г. 16:34 ч., David Sterba wrote:
> On Fri, Jul 10, 2020 at 01:10:25PM +0300, Nikolay Borisov wrote:
>>> +static int check_fsflags(unsigned int old_flags, unsigned int flags)
>>>  {
>>>  	if (flags & ~(FS_IMMUTABLE_FL | FS_APPEND_FL | \
>>>  		      FS_NOATIME_FL | FS_NODUMP_FL | \
>>> @@ -174,9 +177,19 @@ static int check_fsflags(unsigned int flags)
>>>  		      FS_NOCOW_FL))
>>>  		return -EOPNOTSUPP;
>>>  
>>> +	/* COMPR and NOCOMP on new/old are valid */
>>>  	if ((flags & FS_NOCOMP_FL) && (flags & FS_COMPR_FL))
>>>  		return -EINVAL;
>>>  
>>> +	if ((flags & FS_COMPR_FL) && (flags & FS_NOCOW_FL))
>>> +		return -EINVAL;
>>> +
>>> +	/* NOCOW and compression options are mutually exclusive */
>>> +	if ((old_flags & FS_NOCOW_FL) && (flags & (FS_COMPR_FL | FS_NOCOMP_FL)))
>>
>> Why is NOCOW and setting NOCOMP (which would really be a NOOP) an
>> invalid combination?
> 
> The options are not conflicting directly, like for the compression and
> nodatacow, but it still is related to compression so it does not feel
> right to allow that even if it's a noop.
> 

Please put this reasoning in the changelog.

  reply	other threads:[~2020-07-10 14:55 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-10 10:05 [PATCH] btrfs: add missing check for nocow and compression inode flags David Sterba
2020-07-10 10:10 ` Nikolay Borisov
2020-07-10 13:34   ` David Sterba
2020-07-10 14:55     ` Nikolay Borisov [this message]
2020-07-10 10:17 ` Johannes Thumshirn
2020-07-10 13:28   ` David Sterba
2020-07-13 10:33 ` [PATCH v2] " David Sterba
2020-07-17 17:08   ` Sasha Levin
2020-07-16  0:27 ` [PATCH] " Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fe45989f-1609-0afa-bc57-6419e4010f1b@suse.com \
    --to=nborisov@suse.com \
    --cc=dsterba@suse.com \
    --cc=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.