Re: [PATCH] Fixed getdevinfo() and dlm_ino_hash() to search for the correct disk name.

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

 



On Thu, Jun 10, 2010 at 10:52:52AM -0400, Eric Anderle wrote:
> What if we added a struct block_device member to dlm_device_list? That
> way we could look it up by major:minor numbers.

I don't know.

By the way:

> > >>> diff --git a/fs/nfsd/nfs4pnfsdlm.c b/fs/nfsd/nfs4pnfsdlm.c
> > >>> index 84caa6e..5a66a71 100644
> > >>> --- a/fs/nfsd/nfs4pnfsdlm.c
> > >>> +++ b/fs/nfsd/nfs4pnfsdlm.c
> > >>> @@ -268,10 +268,13 @@ static int nfsd4_pnfs_dlm_getdevinfo(struct  
> > >>> super_block *sb,
> > >>> 	/*
> > >>> 	 * If the DS list has not been established, return -EINVAL
> > >>> 	 */
> > >>> -	dlm_pdev = nfsd4_find_pnfs_dlm_device(sb->s_bdev->bd_disk- 
> > >>> >disk_name);
> > >>> +	/* Long enough to hold "/dev/" + disk name */
> > >>> +	char full_disk_name[6 + strlen(sb->s_bdev->bd_disk->disk_name)];
> > >>> +	sprintf(full_disk_name, "/dev/%s", sb->s_bdev->bd_disk- 
> > >>> >disk_name);
> > >>> +	dlm_pdev = nfsd4_find_pnfs_dlm_device(full_disk_name);
> > >>> 	if (!dlm_pdev) {
> > >>> 		dprintk("%s: DEBUG: disk %s Not Found\n", __func__,
> > >>> -			sb->s_bdev->bd_disk->disk_name);
> > >>> +			full_disk_name);
> > >>> 		return err;
> > >>> 	}
> > >>>
> > >>> @@ -364,7 +367,10 @@ static int dlm_ino_hash(struct inode *ino)
> > >>> 	/* If can't find the inode block device in the pnfs_dlm_deivce list
> > >>> 	 * then don't hand out a layout
> > >>> 	 */
> > >>> -	de = nfsd4_find_pnfs_dlm_device(ino->i_sb->s_bdev->bd_disk- 
> > >>> >disk_name);
> > >>> +	/* Long enough to hold "/dev/" + disk name */
> > >>> +	char full_disk_name[6 + strlen(ino->i_sb->s_bdev->bd_disk- 
> > >>> >disk_name)];
> > >>> +	sprintf(full_disk_name, "/dev/%s", ino->i_sb->s_bdev->bd_disk- 
> > >>> >disk_name);
> > >>> +	de = nfsd4_find_pnfs_dlm_device(full_disk_name);
> > >>> 	if (!de)
> > >>> 		return -1;
> > >>> 	hash_mask = de->num_ds - 1;

There's some duplicated code there; it should probably go into a common
function called from both places.

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