Linux block layer
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: brauner@kernel.org
Cc: "Ritesh Harjani (IBM)" <ritesh.list@gmail.com>,
	John Garry <john.g.garry@oracle.com>,
	Catherine Hoang <catherine.hoang@oracle.com>,
	linux-ext4@vger.kernel.org, Theodore Ts'o <tytso@mit.edu>,
	Jan Kara <jack@suse.cz>, Christoph Hellwig <hch@infradead.org>,
	Ojaswin Mujoo <ojaswin@linux.ibm.com>,
	linux-block@vger.kernel.org, Dave Chinner <david@fromorbit.com>,
	linux-kernel@vger.kernel.org, linux-xfs@vger.kernel.org,
	linux-fsdevel@vger.kernel.org
Subject: [ANNOUNCE v2] work tree for untorn filesystem writes
Date: Tue, 5 Nov 2024 16:57:40 -0800	[thread overview]
Message-ID: <20241106005740.GM2386201@frogsfrogsfrogs> (raw)

Hi everyone,

Here's a slightly updated working branch for the filesystem side of
atomic write changes for 6.13:

https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux.git/log/?h=fs-atomic_2024-11-05

This branch is, like yesterday's, based off of axboe's
for-6.13/block-atomic branch:

https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git/log/?h=for-6.13/block-atomic

The only difference is that I added Ojaswin's Tested-by: tags to the end
of the xfs series.  I have done basic testing with the shell script at
the end of this email and am satisfied that it at least seems to do the
(limited) things that I think we're targeting for 6.13.

Christian: Could you pull this fs-atomic branch into your vfs.git work
for 6.13, please?  Or would you rather I ask rothwell to include this
branch into for-next/fs-next and send the PR to Linus myself?

(Actually I might just ask rothwell to do that tomorrow regardless...)

--D

#!/bin/bash -x

# Mess around with atomic writes via scsi_debug

mnt=/opt

true "${FSTYP:=xfs}"
true "${MIN_ATOMIC:=32768}"
true "${SECTOR_SIZE:=512}"
true "${FSBLOCK_SIZE:=4096}"

umount $mnt
rmmod "$FSTYP"

rmmod scsi_debug
modprobe scsi_debug atomic_wr=1 dev_size_mb=300 \
	SECTOR_SIZE=$SECTOR_SIZE \
	atomic_wr_align=$((MIN_ATOMIC / SECTOR_SIZE)) \
	atomic_wr_gran=$((MIN_ATOMIC / SECTOR_SIZE))

sleep 1
dev="$(readlink -m /dev/disk/by-id/wwn-0x3333333000*)"
sysfs=/sys/block/$(basename "$dev")

sysfs-dump $sysfs/queue/atomic_write_*

for ((i = 9; i < 20; i++)); do
	xfs_io -d -c "pwrite -b 1m -V 1 -AD $((2 ** i)) $((2 ** i))" $dev
done

case "$FSTYP" in
"xfs")
	mkfs.xfs -f $dev -b size=$MIN_ATOMIC
	;;
"ext4")
	mkfs.ext4 -F $dev -b $FSBLOCK_SIZE -C $MIN_ATOMIC -O bigalloc
	;;
*)
	echo "$FSTYP: not recognized"
	exit 1
	;;
esac
mount $dev $mnt

xfs_io -f -c 'falloc 0 1m' -c fsync $mnt/a
filefrag -v $mnt/a

for ((i = 9; i < 20; i++)); do
	xfs_io -d -c "pwrite -b 1m -V 1 -AD $((2 ** i)) $((2 ** i))" $mnt/a
done

# does not support buffered io
xfs_io -c "pwrite -b 1m -V 1 -AD 0 $MIN_ATOMIC" $mnt/a
# does not support unaligned directio
xfs_io -c "pwrite -b 1m -V 1 -AD $SECTOR_SIZE $MIN_ATOMIC" $mnt/a

             reply	other threads:[~2024-11-06  0:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-06  0:57 Darrick J. Wong [this message]
2024-11-06  9:50 ` [ANNOUNCE v2] work tree for untorn filesystem writes Christian Brauner
2024-11-06 16:15   ` Darrick J. Wong
2024-11-07 13:49   ` Carlos Maiolino

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241106005740.GM2386201@frogsfrogsfrogs \
    --to=djwong@kernel.org \
    --cc=brauner@kernel.org \
    --cc=catherine.hoang@oracle.com \
    --cc=david@fromorbit.com \
    --cc=hch@infradead.org \
    --cc=jack@suse.cz \
    --cc=john.g.garry@oracle.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=ojaswin@linux.ibm.com \
    --cc=ritesh.list@gmail.com \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox