linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* 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
* 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).