Skip to content

Commit 9b2e687

Browse files
Vitaliy Filippovkawasaki
authored andcommitted
Do not require atomic writes to be power of 2 sized and aligned on length boundary
It contradicts NVMe specification where alignment is only required when atomic write boundary (NABSPF/NABO) is set and highly limits usage of NVMe atomic writes Signed-off-by: Vitaliy Filippov <vitalifster@gmail.com>
1 parent 06634b5 commit 9b2e687

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

fs/read_write.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1802,17 +1802,9 @@ int generic_file_rw_checks(struct file *file_in, struct file *file_out)
18021802

18031803
int generic_atomic_write_valid(struct kiocb *iocb, struct iov_iter *iter)
18041804
{
1805-
size_t len = iov_iter_count(iter);
1806-
18071805
if (!iter_is_ubuf(iter))
18081806
return -EINVAL;
18091807

1810-
if (!is_power_of_2(len))
1811-
return -EINVAL;
1812-
1813-
if (!IS_ALIGNED(iocb->ki_pos, len))
1814-
return -EINVAL;
1815-
18161808
if (!(iocb->ki_flags & IOCB_DIRECT))
18171809
return -EOPNOTSUPP;
18181810

0 commit comments

Comments
 (0)