Re: remote devices

2014-06-03 Thread Valdis . Kletnieks
On Mon, 02 Jun 2014 19:12:47 -0700, riya khanna said:

> Thanks for pointing this out! I was wondering if it is possible to use
> a remote GPU through /dev/gpu.

No.

The upshot is that whenever you open a character or block special device, it's
handled as a local reference, even if the directory entry came off a remote
filesystem.  So if /dev/null is char device 3,0, then any other reference to
char dev 3,0 will open the same /dev/null, and if /dev/sda5 is block device
8,5, then any open of block 8,5 will get the same device, and so on, whether
it's in /tmp, or /home, or /some/other/NFS-mounted-path (unless
it's on a file system mounted 'nodev', which exists specifically to stop that
sort of security issue).



pgpCcBSAoU_w7.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: remote devices

2014-06-02 Thread Pranay Srivastava
On Tue, Jun 3, 2014 at 7:42 AM, riya khanna  wrote:
> Hi Pranay,
>
> Thanks for pointing this out! I was wondering if it is possible to use
> a remote GPU through /dev/gpu.
>
You would need to modify the nfs client code i think for this. But
since it's a device file and if you don't have a fixed major number
that could be a problem since you wouldn't want to change any other
device files behavior with your installation of file ops.

Have you thought of doing a server/client instead of doing it via NFS.
If it's just GPU you care about maybe you can have a client/server of
your own that can communicate for the GPU exclusively. Perhaps you can
give it a try and then see if NFS is better option.

> -Riya
>
> On Sat, May 31, 2014 at 11:35 PM, Pranay Srivastava  wrote:
>> Hi Riya,
>>
>> It's actually not the major and minor numbers, sure they decide the
>> driver and the device but when it comes to read/write you actually
>> have file_operations. So I digged around a bit and this is the one you
>> should look into,
>>
>> nfs_fhget
>>
>> If you see at the end where it installs the inode->i_op and
>> inode->fop, the device files are initialized just like as if they were
>> on the NFS client machine itself. NFS operations are not used to
>> override device files here. How about using iSCSI and all for devices?
>>
>> Maybe you can tell something more about what you are trying to do?
>>
>> Regards,
>>
>> On Thu, May 29, 2014 at 10:53 PM, riya khanna  
>> wrote:
>>> Hi,
>>>
>>> I'm trying to access remote devices locally by mounting/exporting /dev nodes
>>> over NFS. However, looks like the access requests are treated local based on
>>> major minor numbers (e.g. "cat /mnt-dev-over-nfs/kmg" output is same as "cat
>>> /dev/kmsg")
>>>
>>> How can I change this behavior? and if it is at all feasible?
>>>
>>> Thanks,
>>> Riya
>>>
>>>
>>> ___
>>> Kernelnewbies mailing list
>>> Kernelnewbies@kernelnewbies.org
>>> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>>>
>>
>>
>>
>> --
>> ---P.K.S



-- 
---P.K.S

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: remote devices

2014-06-02 Thread riya khanna
Hi Pranay,

Thanks for pointing this out! I was wondering if it is possible to use
a remote GPU through /dev/gpu.

-Riya

On Sat, May 31, 2014 at 11:35 PM, Pranay Srivastava  wrote:
> Hi Riya,
>
> It's actually not the major and minor numbers, sure they decide the
> driver and the device but when it comes to read/write you actually
> have file_operations. So I digged around a bit and this is the one you
> should look into,
>
> nfs_fhget
>
> If you see at the end where it installs the inode->i_op and
> inode->fop, the device files are initialized just like as if they were
> on the NFS client machine itself. NFS operations are not used to
> override device files here. How about using iSCSI and all for devices?
>
> Maybe you can tell something more about what you are trying to do?
>
> Regards,
>
> On Thu, May 29, 2014 at 10:53 PM, riya khanna  
> wrote:
>> Hi,
>>
>> I'm trying to access remote devices locally by mounting/exporting /dev nodes
>> over NFS. However, looks like the access requests are treated local based on
>> major minor numbers (e.g. "cat /mnt-dev-over-nfs/kmg" output is same as "cat
>> /dev/kmsg")
>>
>> How can I change this behavior? and if it is at all feasible?
>>
>> Thanks,
>> Riya
>>
>>
>> ___
>> Kernelnewbies mailing list
>> Kernelnewbies@kernelnewbies.org
>> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>>
>
>
>
> --
> ---P.K.S

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: remote devices

2014-05-31 Thread Pranay Srivastava
Hi Riya,

It's actually not the major and minor numbers, sure they decide the
driver and the device but when it comes to read/write you actually
have file_operations. So I digged around a bit and this is the one you
should look into,

nfs_fhget

If you see at the end where it installs the inode->i_op and
inode->fop, the device files are initialized just like as if they were
on the NFS client machine itself. NFS operations are not used to
override device files here. How about using iSCSI and all for devices?

Maybe you can tell something more about what you are trying to do?

Regards,

On Thu, May 29, 2014 at 10:53 PM, riya khanna  wrote:
> Hi,
>
> I'm trying to access remote devices locally by mounting/exporting /dev nodes
> over NFS. However, looks like the access requests are treated local based on
> major minor numbers (e.g. "cat /mnt-dev-over-nfs/kmg" output is same as "cat
> /dev/kmsg")
>
> How can I change this behavior? and if it is at all feasible?
>
> Thanks,
> Riya
>
>
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>



-- 
---P.K.S

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


remote devices

2014-05-31 Thread riya khanna
Hi,

I'm trying to access remote devices locally by mounting/exporting /dev
nodes over NFS. However, looks like the access requests are treated local
based on major minor numbers (e.g. "cat /mnt-dev-over-nfs/kmg" output is
same as "cat /dev/kmsg")

How can I change this behavior? and if it is at all feasible?

Thanks,
Riya
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies