Re: [PATCH v8 22/32] pnfs: layoutreturn

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

 



On 05/26/2011 12:29 AM, Benny Halevy wrote:

<snip>

> +/* Initiates a LAYOUTRETURN(FILE) */
> +int
> +_pnfs_return_layout(struct inode *ino)
> +{
> +	struct pnfs_layout_hdr *lo = NULL;
> +	struct nfs_inode *nfsi = NFS_I(ino);
> +	LIST_HEAD(tmp_list);
> +	struct nfs4_layoutreturn *lrp;
> +	nfs4_stateid stateid;
> +	int status = 0;
> +
> +	dprintk("--> %s\n", __func__);
> +
> +	spin_lock(&ino->i_lock);
> +	lo = nfsi->layout;
> +	if (!lo || !mark_matching_lsegs_invalid(lo, &tmp_list, NULL)) {
> +		spin_unlock(&ino->i_lock);
> +		dprintk("%s: no layout segments to return\n", __func__);
> +		goto out;
> +	}
> +	stateid = nfsi->layout->plh_stateid;
> +	/* Reference matched in nfs4_layoutreturn_release */
> +	get_layout_hdr(lo);
> +	spin_unlock(&ino->i_lock);
> +	pnfs_free_lseg_list(&tmp_list);
> +
> +	WARN_ON(test_bit(NFS_INO_LAYOUTCOMMIT, &nfsi->flags));
> +
> +	lrp = kzalloc(sizeof(*lrp), GFP_KERNEL);
> +	if (unlikely(lrp == NULL)) {
-	if (unlikely(lrp == NULL)) {
+	if (unlikely(!lrp)) {

Benny what happened to the:
		put_layout_hdr(lo);

That was there the last version? It is still most needed!

If you are at it also please do the above change as well

Boaz
> +		status = -ENOMEM;
> +		goto out;
> +	}
> +
> +	lrp->args.stateid = stateid;
> +	lrp->args.layout_type = NFS_SERVER(ino)->pnfs_curr_ld->id;
> +	lrp->args.inode = ino;
> +	lrp->clp = NFS_SERVER(ino)->nfs_client;
> +
> +	status = nfs4_proc_layoutreturn(lrp);
> +out:
> +	dprintk("<-- %s status: %d\n", __func__, status);
> +	return status;
> +}
> +
--
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