[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5e7eb717-d810-4dc3-80b0-3baaa20ca41f@oracle.com>
Date: Thu, 7 Mar 2024 11:55:59 +0000
From: John Garry <john.g.garry@...cle.com>
To: Dave Chinner <david@...morbit.com>
Cc: djwong@...nel.org, hch@....de, viro@...iv.linux.org.uk, brauner@...nel.org,
jack@...e.cz, chandan.babu@...cle.com, axboe@...nel.dk,
martin.petersen@...cle.com, linux-kernel@...r.kernel.org,
linux-xfs@...r.kernel.org, linux-fsdevel@...r.kernel.org,
tytso@....edu, jbongio@...gle.com, ojaswin@...ux.ibm.com,
ritesh.list@...il.com, linux-block@...r.kernel.org
Subject: Re: [PATCH v2 14/14] fs: xfs: Support setting FMODE_CAN_ATOMIC_WRITE
On 06/03/2024 21:33, Dave Chinner wrote:
>> +static bool xfs_file_open_can_atomicwrite(
>> + struct inode *inode,
>> + struct file *file)
>> +{
>> + struct xfs_inode *ip = XFS_I(inode);
>> + struct xfs_buftarg *target = xfs_inode_buftarg(ip);
>> +
>> + if (!(file->f_flags & O_DIRECT))
>> + return false;
>> +
>> + if (!xfs_inode_atomicwrites(ip))
>> + return false;
>> +
>> + if (!bdev_can_atomic_write(target->bt_bdev))
>> + return false;
> Again, this is static blockdev information - the inode atomic write
> flag should not be set if the bdev cannot do atomic writes. It
> should be checked at mount time
ok
> - the filesystem probably should
> only mount read-only if it is configured to allow atomic writes and
> the underlying blockdev does not support atomic writes...
Let me know if you really would like to see that change also. It does
seem a bit drastic, considering we can just disallow atomic writes.
Thanks,
John
Powered by blists - more mailing lists