Re: [PATCH] pnfs: call layoutcommit after flushing inode's data to disk.

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

 



This is for a bug introduced to 2.6.34. In 2.6.32 and 2.6.33 we call
layoutcommit in
nfs_sync_mapping_wait(), but in 2.6.34 we use sync_inode() to sync
inode's data, so
the layoutcommit code is gone.

BTW: In current code, layoutcommit_ctx will increase refcount of
nfs_inode's ctx, so if
layoutcommit_ctx is not NULL, we could not reach nfs4_close_context
... --> __nfs_close().
So pnfs_layoutcommit_inode() in __nfs_close() will not be called in
whatever situation.
Why we have to use nfs_inode's ctx as layoutcommit_ctx, since we only
need its rpc_creds
actually?

On Thu, May 20, 2010 at 11:28 AM, Tao Guo <guotao@xxxxxxxxxxxx> wrote:
> Signed-off-by: Tao Guo <guotao@xxxxxxxxxxxx>
> ---
>  fs/nfs/write.c |    8 +++++++-
>  1 files changed, 7 insertions(+), 1 deletions(-)
>
> diff --git a/fs/nfs/write.c b/fs/nfs/write.c
> index d3e1645..b4f48b2 100644
> --- a/fs/nfs/write.c
> +++ b/fs/nfs/write.c
> @@ -1558,6 +1558,7 @@ int nfs_write_inode(struct inode *inode, struct writeback_control *wbc)
>  */
>  int nfs_wb_all(struct inode *inode)
>  {
> +       int ret;
>        struct writeback_control wbc = {
>                .sync_mode = WB_SYNC_ALL,
>                .nr_to_write = LONG_MAX,
> @@ -1565,7 +1566,12 @@ int nfs_wb_all(struct inode *inode)
>                .range_end = LLONG_MAX,
>        };
>
> -       return sync_inode(inode, &wbc);
> +       ret = sync_inode(inode, &wbc);
> +#ifdef CONFIG_NFS_V4_1
> +       if (!ret && NFS_I(inode)->layoutcommit_ctx)
> +               ret = pnfs_layoutcommit_inode(inode, 1);
> +#endif
> +       return ret;
>  }
>
>  int nfs_wb_page_cancel(struct inode *inode, struct page *page)
> --
> 1.6.3.3
>
> --
> 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
>



-- 
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