Re: [PATCH] ext4/054,ext4/055: don't run when using DAX

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]



On Wed, Apr 27, 2022 at 10:53:24AM -0400, Theodore Ts'o wrote:
> On Wed, Apr 27, 2022 at 04:05:40PM +0800, Zorro Lang wrote:
> > 
> > "The DAX code currently only supports files with a block size equal to your
> > kernel's PAGE_SIZE" [1], so I suppose any cases with smaller blocksize (< pagesize)
> > should "_exclude_scratch_mount_option dax".
> > 
> > And if this supposition is right, we'd better do "skipping dax testing if blocksize
> > is less than pagesize" in a common helper. Good news is we have _scratch_mkfs_blocksized.
> > So how about do:
> >   if [ $blocksize < $pagesize ];then
> >       _exclude_scratch_mount_option dax
> >   fi
> > in _scratch_mkfs_blocksized? then let ext4/054 and ext4/055 turn to use _scratch_mkfs_blocksized.
> 
> That's a good thing to and it would work for ext4/054 and ext/022
> (which already uses "_exclude_scratch_mount_option dax" and
> "_scratch_mkfs").  However, a number of other tests, including
> ext4/055 and ext4/035 need to give additional parameters to mfks, such
> as "-O quota" or "-E resize=262144".
> 
> So _scratch_mkfs_blocksized isn't always going to work for tests in
> ext4/* where we often are passing ext4-specific mkfs options to
> mkfs.ext4.
> 
> So I can add your suggestion to _scratch_mkfs_blocksized, and use that
> for ext4/054, but it's not going to be a solution for ext4/055.

I just noticed that _scratch_mkfs_sized() and _scratch_mkfs_blocksized() both use
_scratch_mkfs_xfs for XFS, I'm wondering if ext4 would like to use _scratch_mkfs_ext4()
or even use _scratch_mkfs() directly in these two functions. Then you can do something
likes:
  MKFS_OPTIONS="$MKFS_OPTIONS -F -O quota"
  _scratch_mkfs_blocksized 1024
or:
  MKFS_OPTIONS="$MKFS_OPTIONS -F -O quota" _scratch_mkfs_blocksized 1024

Hmm... that might look a little ugly... it's doesn't matter if we write as:
  _exclude_scratch_mount_option dax
  _scratch_mkfs "-F -O quota -b 1024"

We just provide a helper to avoid someone forget 'dax', I don't object someone would
like to "exclude dax" by explicit method :) So if you don't have much time to do this
change, you can just do what you said above, then I'll take another time/chance to
change _scratch_mkfs_* things.

Maybe we should think about let all _scratch_mkfs_*[1] helpers use _scratch_mkfs
consistently. But that will change and affect too many things. I don't want to break
fundamental code too much, might be better to let each fs help to change and test
that bit by bit, when they need :)

Thanks,
Zorro


$ grep -rs _scratch_mkfs_.*() common/
common/casefold:_scratch_mkfs_casefold()
common/casefold:_scratch_mkfs_casefold_strict()
common/encrypt:_scratch_mkfs_encrypted()
common/encrypt:_scratch_mkfs_sized_encrypted()
common/encrypt:_scratch_mkfs_stable_inodes_encrypted()
common/verity:_scratch_mkfs_verity()
common/verity:_scratch_mkfs_encrypted_verity()
common/rc:_scratch_mkfs_options()
common/rc:_scratch_mkfs_sized()
common/rc:_scratch_mkfs_geom()
common/rc:_scratch_mkfs_blocksized()
common/rc:_scratch_mkfs_richacl()

> 
> Cheers,
> 
> 						- Ted
> 




[Index of Archives]     [Linux Filesystems Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux