[v2,2/2] ocfs2: use ocfs2_update_inode_fsync_trans() to access t_tid in handle->h_transaction
diff mbox series

Message ID 6ff9a312-5f7d-0e27-fb51-bc4e062fcd97@huawei.com
State New
Headers show
Series
  • [v2,1/2] ocfs2: fix a NULL pointer dereference when call ocfs2_update_inode_fsync_trans()
Related show

Commit Message

Wangyan Jan. 11, 2020, 8:47 a.m. UTC
For the uniform format, we use ocfs2_update_inode_fsync_trans()
to access t_tid in handle->h_transaction

Signed-off-by: Yan Wang <wangyan122@huawei.com>
Reviewed-by: Jun Piao <piaojun@huawei.com>
---
 fs/ocfs2/namei.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Joseph Qi Jan. 12, 2020, 1:57 a.m. UTC | #1
On 20/1/11 16:47, wangyan wrote:
> For the uniform format, we use ocfs2_update_inode_fsync_trans()
> to access t_tid in handle->h_transaction
> 
> Signed-off-by: Yan Wang <wangyan122@huawei.com>
> Reviewed-by: Jun Piao <piaojun@huawei.com>

Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com>
> ---
>  fs/ocfs2/namei.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/fs/ocfs2/namei.c b/fs/ocfs2/namei.c
> index 8ea51cf27b97..da65251ef815 100644
> --- a/fs/ocfs2/namei.c
> +++ b/fs/ocfs2/namei.c
> @@ -586,8 +586,7 @@ static int __ocfs2_mknod_locked(struct inode *dir,
>  			mlog_errno(status);
>  	}
> 
> -	oi->i_sync_tid = handle->h_transaction->t_tid;
> -	oi->i_datasync_tid = handle->h_transaction->t_tid;
> +	ocfs2_update_inode_fsync_trans(handle, inode, 1);
> 
>  leave:
>  	if (status < 0) {
>

Patch
diff mbox series

diff --git a/fs/ocfs2/namei.c b/fs/ocfs2/namei.c
index 8ea51cf27b97..da65251ef815 100644
--- a/fs/ocfs2/namei.c
+++ b/fs/ocfs2/namei.c
@@ -586,8 +586,7 @@  static int __ocfs2_mknod_locked(struct inode *dir,
 			mlog_errno(status);
 	}

-	oi->i_sync_tid = handle->h_transaction->t_tid;
-	oi->i_datasync_tid = handle->h_transaction->t_tid;
+	ocfs2_update_inode_fsync_trans(handle, inode, 1);

 leave:
 	if (status < 0) {