mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-12-28 10:15:32 -05:00
xfs: reject max_atomic_write mount option for no reflink
If the FS has no reflink, then atomic writes greater than 1x block are not
supported. As such, for no reflink it is pointless to accept setting
max_atomic_write when it cannot be supported, so reject max_atomic_write
mount option in this case.
It could be still possible to accept max_atomic_write option of size 1x
block if HW atomics are supported, so check for this specifically.
Fixes: 4528b90527 ("xfs: allow sysadmins to specify a maximum atomic write limit at mount time")
Signed-off-by: John Garry <john.g.garry@oracle.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
This commit is contained in:
committed by
Carlos Maiolino
parent
68456d05eb
commit
8dc5e9b037
@@ -779,6 +779,25 @@ xfs_set_max_atomic_write_opt(
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (xfs_has_reflink(mp))
|
||||
goto set_limit;
|
||||
|
||||
if (new_max_fsbs == 1) {
|
||||
if (mp->m_ddev_targp->bt_awu_max ||
|
||||
(mp->m_rtdev_targp && mp->m_rtdev_targp->bt_awu_max)) {
|
||||
} else {
|
||||
xfs_warn(mp,
|
||||
"cannot support atomic writes of size %lluk with no reflink or HW support",
|
||||
new_max_bytes >> 10);
|
||||
return -EINVAL;
|
||||
}
|
||||
} else {
|
||||
xfs_warn(mp,
|
||||
"cannot support atomic writes of size %lluk with no reflink support",
|
||||
new_max_bytes >> 10);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
set_limit:
|
||||
error = xfs_calc_atomic_write_reservation(mp, new_max_fsbs);
|
||||
if (error) {
|
||||
|
||||
Reference in New Issue
Block a user