Project

General

Profile

Actions

Bug #4646

open

kcephfs: writeback pagevec pool size vs stripe unit limit

Added by Alex Elder about 11 years ago. Updated over 9 years ago.

Status:
Need More Info
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
% Done:

0%

Source:
Development
Tags:
Backport:
Regression:
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Crash signature (v1):
Crash signature (v2):

Description

This was described here:
http://tracker.ceph.com/issues/4603
But that issue has been closed after fixing the most
obvious and simple bugs it described.

The following may still be an issue though, so I'm
the description I made in that issue here so it can
be looked at and either dealt with or ignored.

----------------
I forgot to mention, the other problem is that the number
of pages required in ceph_writepages_start() is computed
as (essentially):

    max_size = 1 << inode->i_blkbits;
    if (fsc->mount_options->wsize && fsc->mount_options->wsize < max_size)
        max_size = fsc->mount_options->wsize;
    if (max_size < PAGE_CACHE_SIZE)
        max_size = PAGE_CACHE_SIZE;
    pages_required = max_size >> PAGE_CACHE_SHIFT;

So as mentioned above, we need at least one page. But in addition
if the "wsize" mount option has value 0 (which is the default), then
the number of pages required could be as much as

    inode->i_blkbits >> PAGE_CACHE_SHIFT

And that is initialized in fs/ceph/inode.c:fill_inode() as:

        inode->i_blkbits = fls(le32_to_cpu(info->layout.fl_stripe_unit)) - 1;

The layout comes from the mds, but it looks to me like the
stripe unit therein can be set without limit by an ioctl() via
CEPH_MDS_OP_SETLAYOUT or CEPH_MDS_OP_SETDIRLAYOUT.

So bottom line of all this is that inside ceph_writepages_start()
if we are going to fall back to using the memory pool to satisfy
our request for a page pointer array, the size of the array in
the pool needs to be sufficient to hold the maximum sized stripe
unit value (which is apparently 0xffffffff).

My fix addresses the more simple issues described initially. I
do not intend to address this broader problem, I'll leave it to
someone else (or at least some other time) to fix that.

Actions

Also available in: Atom PDF