diff options
-rw-r--r-- | fs/ceph/inode.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c index 9bda8c7a80a0..879bc0825093 100644 --- a/fs/ceph/inode.c +++ b/fs/ceph/inode.c @@ -789,7 +789,12 @@ static int fill_inode(struct inode *inode, struct page *locked_page, ci->i_version = le64_to_cpu(info->version); inode->i_version++; inode->i_rdev = le32_to_cpu(info->rdev); - inode->i_blkbits = fls(le32_to_cpu(info->layout.fl_stripe_unit)) - 1; + /* directories have fl_stripe_unit set to zero */ + if (le32_to_cpu(info->layout.fl_stripe_unit)) + inode->i_blkbits = + fls(le32_to_cpu(info->layout.fl_stripe_unit)) - 1; + else + inode->i_blkbits = CEPH_BLOCK_SHIFT; if ((new_version || (new_issued & CEPH_CAP_AUTH_SHARED)) && (issued & CEPH_CAP_AUTH_EXCL) == 0) { |