From: Arne Jansen <sensille@gmx.net>
To: Alexander Block <ablock84@googlemail.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [RFC PATCH 4/7] Btrfs: introduce subvol uuids and times
Date: Tue, 24 Jul 2012 07:55:52 +0200 [thread overview]
Message-ID: <500E38E8.60609@gmx.net> (raw)
In-Reply-To: <CAB9VWqAqiVKC3rBEYcUzF58UVYtnniOTQQ_gLAEAOUOWofArXw@mail.gmail.com>
On 23.07.2012 21:41, Alexander Block wrote:
> On Mon, Jul 16, 2012 at 4:56 PM, Arne Jansen <sensille@gmx.net> wrote:
>> On 04.07.2012 15:38, Alexander Block wrote:
>>> +
>>> + ret = btrfs_update_root(trans, root->fs_info->tree_root,
>>> + &root->root_key, &root->root_item);
>>> + if (ret < 0) {
>>> + goto out;
>>
>> are you leaking a trans handle here?
>>
> btrfs_update_root is aborting the transaction in case of failure. Do I
> still need to call end_transaction?
It's your handle, you should free it.
...
>>>
>>> +struct btrfs_ioctl_received_subvol_args {
>>> + char uuid[BTRFS_UUID_SIZE]; /* in */
>>> + __u64 stransid; /* in */
>>> + __u64 rtransid; /* out */
>>> + struct timespec stime; /* in */
>>> + struct timespec rtime; /* out */
>>> + __u64 reserved[16];
>>
>> What is this reserved used for? I don't see a mechanism that could be
>> used to signal that there are useful information here, other than
>> using a different ioctl.
>>
> The reserved is a result of a suggestion made by David. I can remove
> it again if you want...
I don't argue against some reserved space, I only have problems to
see how you can make use of them in the future when there's no way
to signal that they contain valid information. I should be sufficient
to define the reserved values to be 0 at the moment.
>>> +};
>>> +
>>> #define BTRFS_IOC_SNAP_CREATE _IOW(BTRFS_IOCTL_MAGIC, 1, \
>>> struct btrfs_ioctl_vol_args)
>>> #define BTRFS_IOC_DEFRAG _IOW(BTRFS_IOCTL_MAGIC, 2, \
>>> @@ -359,6 +368,10 @@ struct btrfs_ioctl_get_dev_stats {
>>> struct btrfs_ioctl_ino_path_args)
>>> #define BTRFS_IOC_LOGICAL_INO _IOWR(BTRFS_IOCTL_MAGIC, 36, \
>>> struct btrfs_ioctl_ino_path_args)
>>> +
>>> +#define BTRFS_IOC_SET_RECEIVED_SUBVOL _IOWR(BTRFS_IOCTL_MAGIC, 37, \
>>> + struct btrfs_ioctl_received_subvol_args)
>>> +
>>> #define BTRFS_IOC_GET_DEV_STATS _IOWR(BTRFS_IOCTL_MAGIC, 52, \
>>> struct btrfs_ioctl_get_dev_stats)
>>> #define BTRFS_IOC_GET_AND_RESET_DEV_STATS _IOWR(BTRFS_IOCTL_MAGIC, 53, \
>>> diff --git a/fs/btrfs/root-tree.c b/fs/btrfs/root-tree.c
>>> index 24fb8ce..17d638e 100644
>>> --- a/fs/btrfs/root-tree.c
>>> +++ b/fs/btrfs/root-tree.c
>>> @@ -16,6 +16,7 @@
>>> * Boston, MA 021110-1307, USA.
>>> */
>>>
>>> +#include <linux/uuid.h>
>>> #include "ctree.h"
>>> #include "transaction.h"
>>> #include "disk-io.h"
>>> @@ -25,6 +26,9 @@
>>> * lookup the root with the highest offset for a given objectid. The key we do
>>> * find is copied into 'key'. If we find something return 0, otherwise 1, < 0
>>> * on error.
>>> + * We also check if the root was once mounted with an older kernel. If we detect
>>> + * this, the new fields coming after 'level' get overwritten with zeros so to
>>> + * invalidate the fields.
>>
>> ... "This is detected by a mismatch of the 2 generation fields" ... or something
>> like that.
>>
> The current version (found in git only) has this new function which is
> called in find_last_root:
> void btrfs_read_root_item(struct btrfs_root *root,
> struct extent_buffer *eb, int slot,
> struct btrfs_root_item *item)
>
> The comment above this function explains what happens.
ok. Please regard most of my comments as an expression of my thoughts while
reading it. So they mark places where it might be useful to add comments
to make it easier for the next reader :)
next prev parent reply other threads:[~2012-07-24 5:55 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-04 13:38 [RFC PATCH 0/7] Experimental btrfs send/receive (kernel side) Alexander Block
2012-07-04 13:38 ` [RFC PATCH 1/7] Btrfs: use _IOR for BTRFS_IOC_SUBVOL_GETFLAGS Alexander Block
2012-07-04 13:38 ` [RFC PATCH 2/7] Btrfs: add helper for tree enumeration Alexander Block
2012-07-04 13:38 ` [RFC PATCH 3/7] Btrfs: make iref_to_path non static Alexander Block
2012-07-04 13:38 ` [RFC PATCH 4/7] Btrfs: introduce subvol uuids and times Alexander Block
2012-07-05 11:51 ` Alexander Block
2012-07-05 17:08 ` Zach Brown
2012-07-05 17:14 ` Alexander Block
2012-07-05 17:20 ` Zach Brown
2012-07-05 18:33 ` Ilya Dryomov
2012-07-05 18:37 ` Zach Brown
2012-07-05 18:59 ` Ilya Dryomov
2012-07-05 19:01 ` Zach Brown
2012-07-05 19:18 ` Alexander Block
2012-07-05 19:24 ` Ilya Dryomov
2012-07-05 19:43 ` Alexander Block
2012-07-16 14:56 ` Arne Jansen
2012-07-23 19:41 ` Alexander Block
2012-07-24 5:55 ` Arne Jansen [this message]
2012-07-25 10:51 ` Alexander Block
2012-07-04 13:38 ` [RFC PATCH 5/7] Btrfs: add btrfs_compare_trees function Alexander Block
2012-07-04 18:27 ` Alex Lyakas
2012-07-04 19:49 ` Alexander Block
2012-07-04 19:13 ` Alex Lyakas
2012-07-04 20:18 ` Alexander Block
2012-07-04 23:31 ` David Sterba
2012-07-05 12:19 ` Alex Lyakas
2012-07-05 12:47 ` Alexander Block
2012-07-05 13:04 ` Alex Lyakas
2012-07-04 13:38 ` [RFC PATCH 6/7] Btrfs: introduce BTRFS_IOC_SEND for btrfs send/receive (part 1) Alexander Block
2012-07-18 6:59 ` Arne Jansen
2012-07-25 17:33 ` Alexander Block
2012-07-21 10:53 ` Arne Jansen
2012-07-04 13:38 ` [RFC PATCH 7/7] Btrfs: introduce BTRFS_IOC_SEND for btrfs send/receive (part 2) Alexander Block
2012-07-10 15:26 ` Alex Lyakas
2012-07-25 13:37 ` Alexander Block
2012-07-25 17:20 ` Alex Lyakas
2012-07-25 17:41 ` Alexander Block
2012-07-23 11:16 ` Arne Jansen
2012-07-23 15:28 ` Alex Lyakas
2012-07-28 13:49 ` Alexander Block
2012-07-23 15:17 ` Alex Lyakas
2012-08-01 12:54 ` Alexander Block
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=500E38E8.60609@gmx.net \
--to=sensille@gmx.net \
--cc=ablock84@googlemail.com \
--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).