Re: [PATCH 7/9] pnfs/blocklayout: implement the return_range method

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

 



On Wed, Sep 10, 2014 at 11:23 PM, Christoph Hellwig <hch@xxxxxx> wrote:
> This allows removing extents from the extent tree especially on truncate
> operations, and thus fixing reads from truncated and re-extended that
> previously returned stale data.
>
> Signed-off-by: Christoph Hellwig <hch@xxxxxx>
> ---
>  fs/nfs/blocklayout/blocklayout.c | 30 ++++++++++++++++++++++++++++++
>  1 file changed, 30 insertions(+)
>
> diff --git a/fs/nfs/blocklayout/blocklayout.c b/fs/nfs/blocklayout/blocklayout.c
> index 42b6f9c..a7524c4 100644
> --- a/fs/nfs/blocklayout/blocklayout.c
> +++ b/fs/nfs/blocklayout/blocklayout.c
> @@ -470,6 +470,35 @@ static struct pnfs_layout_segment *bl_alloc_lseg(struct pnfs_layout_hdr *lo,
>  }
>
>  static void
> +bl_return_range(struct pnfs_layout_hdr *lo,
> +               struct pnfs_layout_range *range)
> +{
> +       struct pnfs_block_layout *bl = BLK_LO2EXT(lo);
> +       sector_t offset = range->offset >> SECTOR_SHIFT, end;
> +       int err;
> +
> +       if (range->offset % 8) {
why arbitrary block size? You should be able to use the blocksize
returned by server, right?

btw, did you test your patchset with smaller block size such as 2K/1K?
Did it work?

> +               dprintk("%s: offset %lld not block size aligned\n",
> +                       __func__, range->offset);
> +               return;
> +       }
> +
> +       if (range->length != NFS4_MAX_UINT64) {
> +               if (range->length % 8) {
ditto here.

Cheers,
Tao
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux