linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anand Jain <anand.jain@oracle.com>
To: dsterba@suse.cz, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 0/6] cleanup property and extended attribute set
Date: Wed, 17 Apr 2019 18:40:39 +0800	[thread overview]
Message-ID: <cd594b42-dba7-3ea0-5317-4e1dbb23d9f1@oracle.com> (raw)
In-Reply-To: <20190417093142.GC20156@twin.jikos.cz>



On 17/4/19 5:31 PM, David Sterba wrote:
> On Tue, Apr 16, 2019 at 06:01:58AM +0800, Anand Jain wrote:
>>
>>
>> On 16/4/19 3:01 am, David Sterba wrote:
>>> On Fri, Apr 12, 2019 at 04:02:53PM +0800, Anand Jain wrote:
>>>> In an attempt to stream line the property and extended attribute set here
>>>> are the few cleanup patches.
>>>>
>>>>    1/6 to 3/6 are mostly non functional cleanups (except for the conversion
>>>>     to non static function in 3/6) and can be merged together.
>>>>    4/6 removes the readonly root check in btrfs_setxattr() more details in
>>>>     the change log.
>>>>    5/6 as now we have btrfs_setxattr() and btrfs_setxattr_trans() for the
>>>>     threads with transaction and without transaction respectively, so this
>>>>     patch uses them.
>>>>    6/6 as 5/6 as diverted the threads with transaction to btrfs_setxattr(),
>>>>     now btrfs_setxattr_trans() can drop the trans arg.
>>>>
>>>> Anand Jain (6):
>>>>     btrfs: rename btrfs_setxattr to btrfs_setxattr_trans
>>>>     btrfs: rename do_setxattr to btrfs_setxattr
>>>>     btrfs: declare btrfs_setxattr as a non static function
>>>>     btrfs: remove redundant readonly root check in btrfs_setxattr_trans
>>>>     btrfs: split thread with trans to use btrfs_setxattr
>>>>     btrfs: cleanup btrfs_setxattr_trans drop trans arg
>>>
>>> Looks good to me, thanks. The result is very close to what the previous
>>> patchset did. Patchset will go to for-next soon.
>>>
>>
>> Thanks. On top of these, I am writing patches to merge
>> start_transactions in btrfs_ioctl_setflags().
> 
> My current idea how to change btrfs_ioctl_setflags is like that (but I
> haven't prototyped it so it might not work):
> 
> - don't change binode->flags directly, but do all flag updates on a
>    temporary variable
> 
> - if a property needs to be changed, do validation first, then start
>    transaction and pass it to the property handler

  In btrfs_ioctl_setflags() we don't need the validate() at all, as the
  the property strings are hard coded with in the kernel or already
  verified during the mount -o option (fs_info->compress_type).
  So only place where we need the validate is
  btrfs_xattr_handler_set_prop().

Thanks, Anand

> - in the finalizing code, start a transaction unless it's been started
>    already, apply the iflags and end transaction
> 
> This means there are up to 4 starting points of transaction, but the
> property validation should never fail between start/end region. There
> are other potential failures due to ENOMEM or ENOSPC, but that's the
> general set of errors we can't avoid.
> 

      parent reply	other threads:[~2019-04-17 10:40 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-12  8:02 [PATCH 0/6] cleanup property and extended attribute set Anand Jain
2019-04-12  8:02 ` [PATCH 1/6] btrfs: rename btrfs_setxattr to btrfs_setxattr_trans Anand Jain
2019-04-12  8:02 ` [PATCH 2/6] btrfs: rename do_setxattr to btrfs_setxattr Anand Jain
2019-04-12  8:02 ` [PATCH 3/6] btrfs: declare btrfs_setxattr as a non static function Anand Jain
2019-04-12  8:02 ` [PATCH 4/6] btrfs: remove redundant readonly root check in btrfs_setxattr_trans Anand Jain
2019-04-12  8:02 ` [PATCH 5/6] btrfs: split thread with trans to use btrfs_setxattr Anand Jain
2019-04-12  8:02 ` [PATCH 6/6] btrfs: cleanup btrfs_setxattr_trans drop trans arg Anand Jain
2019-04-12  9:33 ` [PATCH 0/6] cleanup property and extended attribute set Anand Jain
2019-04-15 19:01 ` David Sterba
2019-04-15 22:01   ` Anand Jain
2019-04-17  9:31     ` David Sterba
2019-04-17 10:24       ` Anand Jain
2019-04-17 10:40       ` Anand Jain [this message]

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=cd594b42-dba7-3ea0-5317-4e1dbb23d9f1@oracle.com \
    --to=anand.jain@oracle.com \
    --cc=dsterba@suse.cz \
    --cc=linux-btrfs@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).