Skip to contentSkip to conversation

Swapfiles broken on XFS.

DISCUSSION Nigel Cunningham 1 participant 2 messages Jan 9, 2004 2 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 1073620506.3790.21.camel@laptop-linux

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw

Hi again.

Perhaps I wasn't clear enough.

Both the page_io and Suspend can cope fine with block size < 4096. The issue is where they get the information from as to how many blocks per page they actually need to use when called brw_page. At the moment, they both assume that i_sb->s_blocksize and blocksize_bits is the place to go. What you're saying sounds right to me. They should both be looking at i_blkbits and i_blksize in the struct inode, shouldn't they? I'll make the change, test and submit a patch to LKML.

Regards,

Nigel

Quoted 11 lines · Christoph Hellwig
Quoted 2 lines · Nigel Cunningham

It appears to me that a swapfile on an XFS filesystem will not work, at least some of the time.

XFS sets s_blocksize to the filesystem blocksize and bdev->bd_block_size / i_blkbits to the XFS sector size. The first would be 4096 in your case and the latter 512. We cannot set a bigger device block size because XFS log writes are in 512b units.

I don't think the swap code should do any assumptions about any relation of the above two.

Signature · 2 lines
My work on Software Suspend is graciously brought to you by
LinuxFund.org.
#3 lore raw

Hi.

Actually, i_sb->s_blocksize and blocksize_bits both reflect a block size of 4096 too, so that didn't help. What does help is using blksize_size. I'll prepare a patch for Karol and I to try before submitting it to LKML.

Regards,

Nigel

Quoted 28 lines · Nigel Cunningham

Hi again.

Perhaps I wasn't clear enough.

Both the page_io and Suspend can cope fine with block size < 4096. The issue is where they get the information from as to how many blocks per page they actually need to use when called brw_page. At the moment, they both assume that i_sb->s_blocksize and blocksize_bits is the place to go. What you're saying sounds right to me. They should both be looking at i_blkbits and i_blksize in the struct inode, shouldn't they? I'll make the change, test and submit a patch to LKML.

Regards,

Nigel

Quoted 11 lines · Christoph Hellwig
Quoted 2 lines · Nigel Cunningham

It appears to me that a swapfile on an XFS filesystem will not work, at least some of the time.

XFS sets s_blocksize to the filesystem blocksize and bdev->bd_block_size / i_blkbits to the XFS sector size. The first would be 4096 in your case and the latter 512. We cannot set a bigger device block size because XFS log writes are in 512b units.

I don't think the swap code should do any assumptions about any relation of the above two.

Signature · 2 lines
My work on Software Suspend is graciously brought to you by
LinuxFund.org.