2020-04-14 14:18:26

by Ira Weiny

[permalink] [raw]
Subject: [PATCH RFC 1/8] fs/ext4: Narrow scope of DAX check in setflags

From: Ira Weiny <[email protected]>

When preventing DAX and journaling on an inode. Use the effective DAX
check rather than the mount option.

This will be required to support per inode DAX flags.

Signed-off-by: Ira Weiny <[email protected]>
---
fs/ext4/ioctl.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c
index a0ec750018dd..ee3401a32e79 100644
--- a/fs/ext4/ioctl.c
+++ b/fs/ext4/ioctl.c
@@ -405,9 +405,9 @@ static int ext4_ioctl_setflags(struct inode *inode,
if ((jflag ^ oldflags) & (EXT4_JOURNAL_DATA_FL)) {
/*
* Changes to the journaling mode can cause unsafe changes to
- * S_DAX if we are using the DAX mount option.
+ * S_DAX if the inode is DAX
*/
- if (test_opt(inode->i_sb, DAX)) {
+ if (IS_DAX(inode)) {
err = -EBUSY;
goto flags_out;
}
--
2.25.1


2020-04-15 23:13:20

by Jan Kara

[permalink] [raw]
Subject: Re: [PATCH RFC 1/8] fs/ext4: Narrow scope of DAX check in setflags

On Mon 13-04-20 21:00:23, [email protected] wrote:
> From: Ira Weiny <[email protected]>
>
> When preventing DAX and journaling on an inode. Use the effective DAX
> check rather than the mount option.
>
> This will be required to support per inode DAX flags.
>
> Signed-off-by: Ira Weiny <[email protected]>

Looks good to me. You can add:

Reviewed-by: Jan Kara <[email protected]>

Honza

> ---
> fs/ext4/ioctl.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c
> index a0ec750018dd..ee3401a32e79 100644
> --- a/fs/ext4/ioctl.c
> +++ b/fs/ext4/ioctl.c
> @@ -405,9 +405,9 @@ static int ext4_ioctl_setflags(struct inode *inode,
> if ((jflag ^ oldflags) & (EXT4_JOURNAL_DATA_FL)) {
> /*
> * Changes to the journaling mode can cause unsafe changes to
> - * S_DAX if we are using the DAX mount option.
> + * S_DAX if the inode is DAX
> */
> - if (test_opt(inode->i_sb, DAX)) {
> + if (IS_DAX(inode)) {
> err = -EBUSY;
> goto flags_out;
> }
> --
> 2.25.1
>
--
Jan Kara <[email protected]>
SUSE Labs, CR