* RE: Is ext2 freezable?
@ 2014-09-18 6:46 Dexuan Cui
2014-09-18 19:17 ` Theodore Ts'o
0 siblings, 1 reply; 6+ messages in thread
From: Dexuan Cui @ 2014-09-18 6:46 UTC (permalink / raw)
To: linux-ext4@vger.kernel.org
> -----Original Message-----
> From: Dexuan Cui
> Sent: Thursday, September 18, 2014 13:16 PM
> To: linux-ext4@vger.kernel.org
> Subject: Is ext2 freezable?
>
> Hi all,
> I'm running "fsfreeze --freeze /mnt" (/mnt is mounted with an ext2 partition)
> and getting "fsfreeze: /mnt: freeze failed: Operation not supported":
> ...
> code of ioctl_fsfreeze() is:
>
> static int ioctl_fsfreeze(struct file *filp)
> {
> struct super_block *sb = file_inode(filp)->i_sb;
>
> if (!capable(CAP_SYS_ADMIN))
> return -EPERM;
>
> /* If filesystem doesn't support freeze feature, return. */
> if (sb->s_op->freeze_fs == NULL)
> return -EOPNOTSUPP;
>
> /* Freeze */
> return freeze_super(sb);
> }
>
> It seems here sb->s_op->freeze_fs is NULL??? why?
I've got the answer:
ext2.ko itself does support fsfreeze, but typical linux distros don't supply
ext2.ko at all now -- instead, they usually supply ext3.ko and have ext4 builtin.
So when I mount an ext2 partition, actually the kernel is registering the ext4
driver as an ext2 driver and in this case the ext2's s_op->freeze_fs is NULL --
but, why did ext4 choose this behavior for ext2?
Thanks,
-- Dexuan
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Is ext2 freezable?
2014-09-18 6:46 Is ext2 freezable? Dexuan Cui
@ 2014-09-18 19:17 ` Theodore Ts'o
2014-09-19 3:11 ` Dexuan Cui
0 siblings, 1 reply; 6+ messages in thread
From: Theodore Ts'o @ 2014-09-18 19:17 UTC (permalink / raw)
To: Dexuan Cui; +Cc: linux-ext4@vger.kernel.org
On Thu, Sep 18, 2014 at 06:46:21AM +0000, Dexuan Cui wrote:
>
> I've got the answer:
> ext2.ko itself does support fsfreeze, but typical linux distros don't supply
> ext2.ko at all now -- instead, they usually supply ext3.ko and have ext4 builtin.
>
> So when I mount an ext2 partition, actually the kernel is registering the ext4
> driver as an ext2 driver and in this case the ext2's s_op->freeze_fs is NULL --
> but, why did ext4 choose this behavior for ext2?
It wasn't a deliberate design choice. It was just that when
no-journal mode was added to ext4, freeeze support was never
implemented, and up until now, no one had asked for it. We can add it
to ext4; thanks for calling it to our attention.
Cheers,
- Ted
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: Is ext2 freezable?
2014-09-18 19:17 ` Theodore Ts'o
@ 2014-09-19 3:11 ` Dexuan Cui
2015-06-05 11:23 ` Syed Imtiaz
0 siblings, 1 reply; 6+ messages in thread
From: Dexuan Cui @ 2014-09-19 3:11 UTC (permalink / raw)
To: Theodore Ts'o; +Cc: linux-ext4@vger.kernel.org
> -----Original Message-----
> From: Theodore Ts'o [mailto:tytso@mit.edu]
> Sent: Friday, September 19, 2014 3:18 AM
> To: Dexuan Cui
> Cc: linux-ext4@vger.kernel.org
> Subject: Re: Is ext2 freezable?
>
> On Thu, Sep 18, 2014 at 06:46:21AM +0000, Dexuan Cui wrote:
> >
> > I've got the answer:
> > ext2.ko itself does support fsfreeze, but typical linux distros don't supply
> > ext2.ko at all now -- instead, they usually supply ext3.ko and have ext4
> builtin.
> >
> > So when I mount an ext2 partition, actually the kernel is registering the ext4
> > driver as an ext2 driver and in this case the ext2's s_op->freeze_fs is NULL --
> > but, why did ext4 choose this behavior for ext2?
>
> It wasn't a deliberate design choice. It was just that when
> no-journal mode was added to ext4, freeeze support was never
> implemented, and up until now, no one had asked for it. We can add it
> to ext4; thanks for calling it to our attention.
> - Ted
Hi Ted,
Thanks very much for the clarification!
And thanks a lot for implementing this -- I've seen the patches you sent out
several hours ago.
IMO it's useful to have such compatibility, e.g.,
Hyper-V guest has a fsfreeze-based feature to back up the data; the feature
works fine for ext4 partition, but Ubuntu's installer can create /boot
of ext2 partition by default and hence the feature can't work:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1362574
I believe the bug will go away after Ubuntu integrates your patches.
Thanks!
-- Dexuan
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Is ext2 freezable?
2014-09-19 3:11 ` Dexuan Cui
@ 2015-06-05 11:23 ` Syed Imtiaz
2015-06-05 16:47 ` Eric Sandeen
0 siblings, 1 reply; 6+ messages in thread
From: Syed Imtiaz @ 2015-06-05 11:23 UTC (permalink / raw)
To: linux-ext4
Dexuan Cui <decui <at> microsoft.com> writes:
> Hi Ted,
> Thanks very much for the clarification!
>
> And thanks a lot for implementing this -- I've seen the patches you
sent out
> several hours ago.
>
> IMO it's useful to have such compatibility, e.g.,
> Hyper-V guest has a fsfreeze-based feature to back up the data; the
feature
> works fine for ext4 partition, but Ubuntu's installer can create /boot
> of ext2 partition by default and hence the feature can't work:
> https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1362574
>
> I believe the bug will go away after Ubuntu integrates your patches.
>
> Thanks!
Hi Theodore,
CAn you please tell me where can i find these patches. I am unable to
locate it. or the steps the install it ?
Do we have to install it every system that doesnt support fsfreeze in
the ext2 fs.
Your help will be deeply appreciated
thanks in advance
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Is ext2 freezable?
2015-06-05 11:23 ` Syed Imtiaz
@ 2015-06-05 16:47 ` Eric Sandeen
0 siblings, 0 replies; 6+ messages in thread
From: Eric Sandeen @ 2015-06-05 16:47 UTC (permalink / raw)
To: Syed Imtiaz, linux-ext4
On 6/5/15 6:23 AM, Syed Imtiaz wrote:
> Dexuan Cui <decui <at> microsoft.com> writes:
>> Hi Ted,
>> Thanks very much for the clarification!
>>
>> And thanks a lot for implementing this -- I've seen the patches you
> sent out
>> several hours ago.
>>
>> IMO it's useful to have such compatibility, e.g.,
>> Hyper-V guest has a fsfreeze-based feature to back up the data; the
> feature
>> works fine for ext4 partition, but Ubuntu's installer can create /boot
>> of ext2 partition by default and hence the feature can't work:
>> https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1362574
>>
>> I believe the bug will go away after Ubuntu integrates your patches.
>>
>> Thanks!
>
>
> Hi Theodore,
> CAn you please tell me where can i find these patches. I am unable to
> locate it. or the steps the install it ?
> Do we have to install it every system that doesnt support fsfreeze in
> the ext2 fs.
To be clear, the patches were only for ext2-mounted-with-ext4.ko.
The native ext2 driver freezes w/o any problem.
The upstream commit is here:
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=bb04457
and has been fixed upstream since kernel v3.18
-Eric
^ permalink raw reply [flat|nested] 6+ messages in thread
* Is ext2 freezable?
@ 2014-09-18 5:15 Dexuan Cui
0 siblings, 0 replies; 6+ messages in thread
From: Dexuan Cui @ 2014-09-18 5:15 UTC (permalink / raw)
To: linux-ext4@vger.kernel.org
Hi all,
I'm running "fsfreeze --freeze /mnt" (/mnt is mounted with an ext2 partition)
and getting "fsfreeze: /mnt: freeze failed: Operation not supported":
the strace log shows:
open("/mnt", O_RDONLY|O_LARGEFILE) = 3
fstat64(3, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
ioctl(3, FIFREEZE, 0) = -1 EOPNOTSUPP (Operation not supported)
My kernel is 3.16.2.
I know ext3/4 support fs freeze, but I'm not sure about ext2.
Though the above experiment shows it's not supported, but I do see
struct super_operations ext2_sops defines an ext2_freeze() and the
code of ioctl_fsfreeze() is:
static int ioctl_fsfreeze(struct file *filp)
{
struct super_block *sb = file_inode(filp)->i_sb;
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
/* If filesystem doesn't support freeze feature, return. */
if (sb->s_op->freeze_fs == NULL)
return -EOPNOTSUPP;
/* Freeze */
return freeze_super(sb);
}
It seems here sb->s_op->freeze_fs is NULL??? why?
I think I must miss something. Please point it out.
Thanks!
-- Dexuan
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-06-05 16:47 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-18 6:46 Is ext2 freezable? Dexuan Cui
2014-09-18 19:17 ` Theodore Ts'o
2014-09-19 3:11 ` Dexuan Cui
2015-06-05 11:23 ` Syed Imtiaz
2015-06-05 16:47 ` Eric Sandeen
-- strict thread matches above, loose matches on Subject: below --
2014-09-18 5:15 Dexuan Cui
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).