From: Andrew Morton <akpm@linux-foundation.org>
To: "Pranay Kr. Srivastava" <pranjas@gmail.com>
Cc: zippel@linux-m68k.org, linux-fsdevel@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] make affs root lookup from blkdev logical size
Date: Tue, 7 Jul 2015 15:05:52 -0700 [thread overview]
Message-ID: <20150707150552.8131a471283486f4dca45b92@linux-foundation.org> (raw)
In-Reply-To: <1436252342-1643-1-git-send-email-pranjas@gmail.com>
On Tue, 7 Jul 2015 12:29:02 +0530 "Pranay Kr. Srivastava" <pranjas@gmail.com> wrote:
> This patch resolves Bug 16531. When logical blkdev
> size > 512 then sector numbers become larger than
> the device can support.
>
> Make affs start lookup based on the device's logical
> sector size instead of 512.
>
> Reported By: Mark <markk@clara.co.uk>
> Fix Suggessted By: Mark <markk@clara.co.uk>
Can you please send your Signed-off-by: for this? It is described in
Documentation/SubmittingPatches section 11.
> --- a/fs/affs/super.c
> +++ b/fs/affs/super.c
> @@ -18,6 +18,7 @@
> #include <linux/sched.h>
> #include <linux/slab.h>
> #include <linux/writeback.h>
> +#include <linux/blkdev.h>
> #include "affs.h"
>
> static int affs_statfs(struct dentry *dentry, struct kstatfs *buf);
> @@ -352,18 +353,19 @@ static int affs_fill_super(struct super_block *sb, void *data, int silent)
> * blocks, we will have to change it.
> */
>
> - size = sb->s_bdev->bd_inode->i_size >> 9;
> + size = i_size_read(sb->s_bdev->bd_inode) >> 9;
> pr_debug("initial blocksize=%d, #blocks=%d\n", 512, size);
>
> affs_set_blocksize(sb, PAGE_SIZE);
> /* Try to find root block. Its location depends on the block size. */
>
> - i = 512;
> - j = 4096;
> + i = bdev_logical_block_size(sb->s_bdev);
> + j = PAGE_SIZE;
Some architectures have PAGE_SIZE larger than 4k. What effect will
that have?
> if (blocksize > 0) {
> i = j = blocksize;
> size = size / (blocksize / 512);
> }
> +
> for (blocksize = i; blocksize <= j; blocksize <<= 1, size >>= 1) {
> sbi->s_root_block = root_block;
> if (root_block < 0)
prev parent reply other threads:[~2015-07-07 22:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-07 6:59 [PATCH] make affs root lookup from blkdev logical size Pranay Kr. Srivastava
2015-07-07 22:05 ` Andrew Morton [this message]
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=20150707150552.8131a471283486f4dca45b92@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pranjas@gmail.com \
--cc=zippel@linux-m68k.org \
/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;
as well as URLs for NNTP newsgroup(s).