Re: [PATCH 1/8] lscp: support opening mounted filesystem by directory pathname

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

 



On Thursday 03 of March 2011 18:16:03 you wrote:
> By the way, can you enhance the series so that the directory argument
> works for any directories in the filesystem rather than just a mount
> point?


That actually was aim at some point -- to let indicate filesystem by any object 
on it. However, I can't find a reliable way. If you can hint one, I'll gladly 
implement.

First idea was to use stat's (struct stat).st_dev, but it seems there is no 
standard way of translating (minor, major) into filesystem from userspace. 
There's a kernel function for that, but not exposed through syscall. There is 
a custom library function by HP, but it doesn't feel very reasonable to rely 
on it.

Second idea was to process pathname by combination of realpath() and stripping 
segments -- but it turns out dot-dot semantics are broken in POSIX OSes [1] 
making that way unreliable.

One caveat is that a device would not indicate the filesystem it belongs to, 
but a filesystem on a partition/device it addresses.

Another caveat is that processing a NILFS2 stored in a file (say, a HDD image) 
would require some specialized syntax.

While those may not sound very serious for interactive use, I believe that our 
tools would become too unreliable for scripts in some edge cases.

Thus I gave up ;-)

A minimalistic version -- only lstat() [sic] with S_ISDIR() -- would work, but 
that's not very much of a progress to me.


[1] http://doc.cat-v.org/plan_9/4th_edition/papers/lexnames

-- 
dexen deVries

``One can't proceed from the informal to the formal by formal means.''
--
To unsubscribe from this list: send the line "unsubscribe linux-nilfs" 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 BTRFS]     [Linux CIFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux