Re: [PATCH v2] ext2: Remove deprecated DAX support

From: Ashwin Gundarapu

Date: Wed May 27 2026 - 06:58:09 EST


Thanks for the review, Jan. All the style issues you mentioned have
been addressed in v3 and v4:

v3: https://lore.kernel.org/linux-ext4/19e595ac3d0.1a0dcfbe128078.1031782761444069401@xxxxxxxxxxx/
v4: https://lore.kernel.org/linux-ext4/19e5aa07c9b.3a2e576d130187.5289857983023045470@xxxxxxxxxxx/

v3 fixed the spaces-to-tabs indentation issues in inode.c, super.c,
and file.c. It also restored Opt_dax for a graceful mount error message.

v4 changed Opt_xip and Opt_dax from -EINVAL to break with a warning,
per Sashiko AI review, to avoid potential boot failures on systems
with these options in /etc/fstab.

The stray empty lines and tab indentation are all cleaned up in the
latest version (v4).

Thanks,
Ashwin


From: Jan Kara <jack@xxxxxxx>
To: "Ashwin Gundarapu"<linuxuser509@xxxxxxxxxxx>
Cc: "jack"<jack@xxxxxxxx>, "linux-ext4"<linux-ext4@xxxxxxxxxxxxxxx>, "linux-kernel"<linux-kernel@xxxxxxxxxxxxxxx>
Date: Mon, 25 May 2026 22:00:40 +0530
Subject: Re: [PATCH v2] ext2: Remove deprecated DAX support

> On Sun 24-05-26 11:08:53, Ashwin Gundarapu wrote:
> >
> > DAX support in ext2 was deprecated in commit d5a2693f93e4
> > ("ext2: Deprecate DAX") with a removal deadline of end of 2025.
> > Remove all DAX code from ext2 as scheduled.
> >
> > This removes the DAX mount option, IOMAP DAX support, DAX file
> > operations, DAX address_space_operations, and the DAX fault handler.
> >
> > Signed-off-by: Ashwin Gundarapu <linuxuser509@xxxxxxxxxxx>
> > ---
> > v2: Removed unused sbi variable and fixed indentation as reported
> > by kernel test robot.
>
> Thanks for the patch. Some style nits below.
>
> > static ssize_t ext2_file_read_iter(struct kiocb *iocb, struct iov_iter *to)
> > {
> > -#ifdef CONFIG_FS_DAX
> > - if (IS_DAX(iocb->ki_filp->f_mapping->host))
> > - return ext2_dax_read_iter(iocb, to);
> > -#endif
> > +
>
> Stray empty line here.
>
> > if (iocb->ki_flags & IOCB_DIRECT)
> > return ext2_dio_read_iter(iocb, to);
> >
> > @@ -297,10 +188,7 @@ static ssize_t ext2_file_read_iter(struct kiocb *iocb, struct iov_iter *to)
> >
> > static ssize_t ext2_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
> > {
> > -#ifdef CONFIG_FS_DAX
> > - if (IS_DAX(iocb->ki_filp->f_mapping->host))
> > - return ext2_dax_write_iter(iocb, from);
> > -#endif
> > +
>
> ... and here.
>
> > if (iocb->ki_flags & IOCB_DIRECT)
> > return ext2_dio_write_iter(iocb, from);
> >
> > @@ -321,7 +209,7 @@ const struct file_operations ext2_file_operations = {
> > #ifdef CONFIG_COMPAT
> > .compat_ioctl = ext2_compat_ioctl,
> > #endif
> > - .mmap_prepare = ext2_file_mmap_prepare,
> > + .mmap_prepare = generic_file_mmap_prepare,
>
> Please indent this with tab the same way as other methods.
>
> > @@ -841,10 +818,7 @@ static int ext2_iomap_begin(struct inode *inode, loff_t offset, loff_t length,
> >
> > iomap->flags = 0;
> > iomap->offset = (u64)first_block << blkbits;
> > - if (flags & IOMAP_DAX)
> > - iomap->dax_dev = sbi->s_daxdev;
> > - else
> > - iomap->bdev = inode->i_sb->s_bdev;
> > + iomap->bdev = inode->i_sb->s_bdev;
>
> Indented with spaces instead of tabs.
>
> > @@ -1290,12 +1248,8 @@ static int ext2_setsize(struct inode *inode, loff_t newsize)
> >
> > inode_dio_wait(inode);
> >
> > - if (IS_DAX(inode))
> > - error = dax_truncate_page(inode, newsize, NULL,
> > - &ext2_iomap_ops);
> > - else
> > - error = block_truncate_page(inode->i_mapping,
> > - newsize, ext2_get_block);
> > + error = block_truncate_page(inode->i_mapping,
> > + newsize, ext2_get_block);
>
> Indented with spaces instead of tabs.
>
> > if (error)
> > return error;
> >
>
> ...
> > + case Opt_xip:
> > + ext2_msg_fc(fc, KERN_ERR, "DAX support has been removed. Please use ext4 instead.");
> > + return -EINVAL;
>
> Indented with spaces instead of tabs.
>
> > @@ -992,16 +974,8 @@ static int ext2_fill_super(struct super_block *sb, struct fs_context *fc)
> > }
> > blocksize = BLOCK_SIZE << le32_to_cpu(sbi->s_es->s_log_block_size);
> >
> > - if (test_opt(sb, DAX)) {
> > - if (!sbi->s_daxdev) {
> > - ext2_msg(sb, KERN_ERR,
> > - "DAX unsupported by block device. Turning off DAX.");
> > - clear_opt(sbi->s_mount_opt, DAX);
> > - } else if (blocksize != PAGE_SIZE) {
> > - ext2_msg(sb, KERN_ERR, "unsupported blocksize for DAX\n");
> > - clear_opt(sbi->s_mount_opt, DAX);
> > - }
> > - }
> > +
> > +
>
> Stray empty lines.
>
> Honza
> --
> Jan Kara <jack@xxxxxxxx>
> SUSE Labs, CR
>
>