marcingu (Marcin Gurtowski)
User

Projects

User does not belong to any projects.

Today

  • Clear sailing ahead.

Tomorrow

  • Clear sailing ahead.

Sunday

  • Clear sailing ahead.

User Details

User Since
Mar 15 2020, 9:34 AM (214 w, 5 d)
Availability
Available

Recent Activity

Feb 24 2021

marcingu abandoned D28745: Skip caching thumbnails on encrypted filesystems.
Feb 24 2021, 5:16 PM · Frameworks, Dolphin
marcingu added a comment to D28745: Skip caching thumbnails on encrypted filesystems.

Here's the new merge request: https://invent.kde.org/network/kio-extras/-/merge_requests/75

Feb 24 2021, 3:26 PM · Frameworks, Dolphin

Feb 23 2021

marcingu added a comment to D28745: Skip caching thumbnails on encrypted filesystems.

Is this unblocked now that https://invent.kde.org/frameworks/solid/-/merge_requests/19 has been merged?

Feb 23 2021, 6:43 PM · Frameworks, Dolphin

Oct 18 2020

marcingu added a comment to D28745: Skip caching thumbnails on encrypted filesystems.

I think I have the Solid part done, but as I don't know this code well, I'd be grateful if someone more advanced on the subject checked it.

Oct 18 2020, 9:39 AM · Frameworks, Dolphin

Oct 8 2020

marcingu added a comment to D28745: Skip caching thumbnails on encrypted filesystems.

!PING.
I need help from someone with good understanding of Solid to continue.

I'm don't know how to determinate if StorageAccess device is encrypted or not. I wanted to use StorageVolume::usage, but it's not available for all types of devices and doesn't equal encrypted for LUKS encrypted volumes.

At a glance the problem here is actually that depending on the setup the mounted volume isn't necessarily the encrypted volume. e.g. if you make a LUKS encrypted btrfs on /dev/sda1 then sda1 is type LUKS encrypted, but to actually use it that device gets decrypted and mapped into a different name /dev/mapper/luks-123 which is type btrfs and not encrypted. It is only the mapped one that gets mounted which is why the encryption context gets lost along the way.

I'm afraid this will need some adjustment in solid because currently we don't carry that information anywhere that I can see. It is however in the data of udiks2 behind the scenes (dbus property org.freedesktop.UDisks2.Block.CryptoBackingDevice which is a dbuspath of the encrypted backing object) so it should be readily available, just needs putting somewhere in solid. This is also represented in the sysfs through a slave relationship between the two block devices, but I'm guessing using that over udiks2 isn't nearly as portable.
Where to put it I don't really know, probably a new method on one of the interface classes CryptoBackingUDI which returns the UDI representing the backing device.

Oct 8 2020, 5:13 PM · Frameworks, Dolphin

Oct 7 2020

marcingu added a comment to D28745: Skip caching thumbnails on encrypted filesystems.

!PING.

Oct 7 2020, 3:41 PM · Frameworks, Dolphin

Sep 26 2020

marcingu added a comment to D28745: Skip caching thumbnails on encrypted filesystems.

How do we check if file access is encrypted using Solid? Do we need new property/method in StorageAccess?

Sep 26 2020, 1:32 PM · Frameworks, Dolphin

Sep 14 2020

marcingu added a comment to D28745: Skip caching thumbnails on encrypted filesystems.

!PING.
I need help from someone with good understanding of Solid to continue.

Sep 14 2020, 4:22 PM · Frameworks, Dolphin

Sep 5 2020

marcingu added a comment to D28745: Skip caching thumbnails on encrypted filesystems.

Ping!
I'm remanding about question early, because I could do much more work if I get to do it on weekend.

Question:
This code won't save thumbnail for file on any device that isn't StorageVolume or is StorageVolume with usage UsageType::Encrypded.

The whole block can never return true, so it should just be removed, along with all its dependencies.

I tested it once more and it returns true when it should, as expected. What makes you think it doesn't?

Even worse, its almost random:

udi = '/org/kde/fstab///pebbles/foo:/mnt'
  parent = '/org/kde/fstab'  (string)
  vendor = 'pebbles'  (string)
  product = 'foo:/mnt'  (string)
  description = 'foo:/mnt on pebbles'  (string)
  icon = 'network-server'  (string)
  StorageAccess.accessible = false  (bool)
  StorageAccess.filePath = '/mnt'  (string)
  StorageAccess.ignored = false  (bool)
  NetworkShare.type = 'Cifs'  (0x2)  (enum)
  NetworkShare.url = 'smb://pebbles/foo:/mnt'  (string)

if (device.is<Solid::StorageVolume>()) -> false, though it should be cached

udi = '/org/freedesktop/UDisks2/block_devices/dm_2d2'
  parent = '/'  (string)
  vendor = ''  (string)
  product = ''  (string)
  description = '100,0 GiB Hard Drive'  (string)
  icon = 'drive-harddisk-root'  (string)
  Block.major = 254  (0xfe)  (int)
  Block.minor = 2  (0x2)  (int)
  Block.device = '/dev/dm-2'  (string)
  StorageAccess.accessible = true  (bool)
  StorageAccess.filePath = '/'  (string)
  StorageAccess.ignored = true  (bool)
  StorageVolume.ignored = false  (bool)
  StorageVolume.usage = 'FileSystem'  (0x2)  (enum)
  StorageVolume.fsType = 'btrfs'  (string)
  StorageVolume.label = ''  (string)
  StorageVolume.uuid = '5832ebfa-bf02-40d2-bdc7-90403b207b62'  (string)
  StorageVolume.size = 107374182400  (0x1900000000)  (qulonglong)

This is an LUKS encrypted volume so should not be cached ...

Sep 5 2020, 11:03 AM · Frameworks, Dolphin

Sep 4 2020

marcingu added a comment to D28745: Skip caching thumbnails on encrypted filesystems.

Ping!
I'm remanding about question early, because I could do much more work if I get to do it on weekend.

Question:
This code won't save thumbnail for file on any device that isn't StorageVolume or is StorageVolume with usage UsageType::Encrypded.

The whole block can never return true, so it should just be removed, along with all its dependencies.

Sep 4 2020, 9:44 PM · Frameworks, Dolphin
marcingu added a comment to D28745: Skip caching thumbnails on encrypted filesystems.

Ping!
I'm remanding about question early, because I could do much more work if I get to do it on weekend.

Sep 4 2020, 2:13 PM · Frameworks, Dolphin

Sep 2 2020

marcingu added a comment to D28745: Skip caching thumbnails on encrypted filesystems.

Second, I have asked for a full context diff, or even better moving this to invent.kde.org, but @marcingu keeps ignoring this.

Sep 2 2020, 2:15 PM · Frameworks, Dolphin

Aug 27 2020

marcingu updated the diff for D28745: Skip caching thumbnails on encrypted filesystems.

Renaming "deviceIdUnset" to "s_deviceIdUnset"

Aug 27 2020, 5:36 PM · Frameworks, Dolphin

Aug 25 2020

marcingu updated the diff for D28745: Skip caching thumbnails on encrypted filesystems.

Moving allowCache check, so it's done only if thumbnail was created.

Aug 25 2020, 4:20 PM · Frameworks, Dolphin
marcingu updated the diff for D28745: Skip caching thumbnails on encrypted filesystems.

Setting canonical path as value of hadFirstThumbnail

Aug 25 2020, 4:03 PM · Frameworks, Dolphin
marcingu updated the diff for D28745: Skip caching thumbnails on encrypted filesystems.

Removing unnecessary includes

Aug 25 2020, 3:37 PM · Frameworks, Dolphin

Aug 24 2020

marcingu updated the diff for D28745: Skip caching thumbnails on encrypted filesystems.

Using special value instead of 0 as unset m_thumbnailDirDeviceId.
Changing ifdef checks for Q_OS_WIN for consistency.
Moving ifdev check into sharesFilesystemWithThumbRoot, to reduce number of preprocessor directives.

Aug 24 2020, 4:41 PM · Frameworks, Dolphin

Aug 23 2020

marcingu added inline comments to D28745: Skip caching thumbnails on encrypted filesystems.
Aug 23 2020, 10:24 AM · Frameworks, Dolphin

Aug 22 2020

marcingu added inline comments to D28745: Skip caching thumbnails on encrypted filesystems.
Aug 22 2020, 4:44 PM · Frameworks, Dolphin
marcingu added inline comments to D28745: Skip caching thumbnails on encrypted filesystems.
Aug 22 2020, 4:03 PM · Frameworks, Dolphin
marcingu updated the diff for D28745: Skip caching thumbnails on encrypted filesystems.

Skipping usage of POSIX functions and types on Windows

Aug 22 2020, 4:00 PM · Frameworks, Dolphin

Aug 20 2020

marcingu added inline comments to D28745: Skip caching thumbnails on encrypted filesystems.
Aug 20 2020, 4:25 PM · Frameworks, Dolphin
marcingu added inline comments to D28745: Skip caching thumbnails on encrypted filesystems.
Aug 20 2020, 3:57 PM · Frameworks, Dolphin
marcingu updated the diff for D28745: Skip caching thumbnails on encrypted filesystems.

Adding path to error logs

Aug 20 2020, 3:52 PM · Frameworks, Dolphin
marcingu added inline comments to D28745: Skip caching thumbnails on encrypted filesystems.
Aug 20 2020, 1:45 PM · Frameworks, Dolphin

Aug 16 2020

marcingu added inline comments to D28745: Skip caching thumbnails on encrypted filesystems.
Aug 16 2020, 10:26 AM · Frameworks, Dolphin
marcingu updated the diff for D28745: Skip caching thumbnails on encrypted filesystems.

Using solid for getting Device

Aug 16 2020, 9:55 AM · Frameworks, Dolphin

Jul 4 2020

marcingu added a comment to D28745: Skip caching thumbnails on encrypted filesystems.

I made merge request for storageAccessFromPath: https://invent.kde.org/frameworks/solid/-/merge_requests/8

Jul 4 2020, 12:19 PM · Frameworks, Dolphin

Jul 1 2020

marcingu added a comment to D28745: Skip caching thumbnails on encrypted filesystems.

How often do I have to repeat the thumbnailer has to use the canonical path anyway? Please use that.

storageAccessFromPath converts given path into canonical. I figured it should do so anyway, so I'm not doing it again here.

And thats wrong. You need the canonical path in the thumbnailer itself.

Jul 1 2020, 9:26 AM · Frameworks, Dolphin

Jun 30 2020

marcingu added a comment to D28745: Skip caching thumbnails on encrypted filesystems.

How often do I have to repeat the thumbnailer has to use the canonical path anyway? Please use that.

Jun 30 2020, 6:41 AM · Frameworks, Dolphin

Jun 29 2020

marcingu added a comment to D28745: Skip caching thumbnails on encrypted filesystems.

Ok, so far I have implemented Solid::Device::storageAccessFromPath by talking all StorageAccess devices, going though all of them and and returning proper one.
code:

Solid::Device Solid::Device::storageAccessFromPath(const QString &path)
{
    // TODO check if symlinks are in the path
    QFileInfo fileInfo = QFileInfo(path);
    if (!fileInfo.exists()) {
        //TODO error handling
    }
    QSet<QString> checked; //To avoid weird infinete loops
    checked.insert(fileInfo.path());
    while (fileInfo.isSymLink()) {
        fileInfo = QFileInfo(fileInfo.symLinkTarget());
        if (checked.contains(fileInfo.path())) {
            //TODO error handling
        }
        checked.insert(fileInfo.path());
    }
    QDir dir = fileInfo.dir();
    QString canonPath = dir.canonicalPath();
    QList<Device> list = Solid::Device::listFromType(DeviceInterface::Type::StorageAccess);
    Device match;
    int match_length = 0;
    for (Device device: list) {
        StorageAccess *storageAccess = device.as<StorageAccess>();
        if (canonPath.startsWith(storageAccess->filePath()) && storageAccess->filePath().size() > match_length) {
            match_length = storageAccess->filePath().size();
            match = device;
        }
    }
    return match;
}
Jun 29 2020, 10:31 AM · Frameworks, Dolphin

Jun 11 2020

marcingu added a comment to D28745: Skip caching thumbnails on encrypted filesystems.

Ok, so, what I want to do now is to create static method findByPath which is going to return Solid::StorageVolume instance (is there a case in which we can expect something different than StorageVolume?).

Jun 11 2020, 9:43 AM · Frameworks, Dolphin

Jun 6 2020

marcingu added a comment to D28745: Skip caching thumbnails on encrypted filesystems.

Ping! I'm not able to continue without help of someone who knows Solid::Device well.

Jun 6 2020, 10:54 AM · Frameworks, Dolphin

May 31 2020

marcingu added a comment to D28745: Skip caching thumbnails on encrypted filesystems.

I tried to research Solid using api.kde.org (https://api.kde.org/frameworks/solid/html/classSolid_1_1Device.html, https://api.kde.org/frameworks/solid/html/classSolid_1_1StorageVolume.html) and looking for usages of both Solid::Device and Solid::StorageVolume in code but I'm not able to get StorageVolume instance for given file/directory. Could someone help me with that?

May 31 2020, 5:42 PM · Frameworks, Dolphin

May 9 2020

marcingu added inline comments to D28745: Skip caching thumbnails on encrypted filesystems.
May 9 2020, 10:53 AM · Frameworks, Dolphin

May 2 2020

marcingu added a comment to D28745: Skip caching thumbnails on encrypted filesystems.

PING!
Is current code fine or should we get rid of KMountPoint completely somehow?

May 2 2020, 9:13 AM · Frameworks, Dolphin

Apr 26 2020

marcingu added inline comments to D28745: Skip caching thumbnails on encrypted filesystems.
Apr 26 2020, 3:44 PM · Frameworks, Dolphin
marcingu updated the diff for D28745: Skip caching thumbnails on encrypted filesystems.

Moving check for sharing filesystem with thumbroot into new method.

Apr 26 2020, 3:43 PM · Frameworks, Dolphin

Apr 25 2020

marcingu added a comment to D28745: Skip caching thumbnails on encrypted filesystems.

Unless there's way to get rid of KMountPoint completely, this should reduce number of calls to minimum.

Apr 25 2020, 12:08 PM · Frameworks, Dolphin
marcingu updated the diff for D28745: Skip caching thumbnails on encrypted filesystems.

Limiting usage of KMountPoint and lstat to max once per directory.

Apr 25 2020, 12:06 PM · Frameworks, Dolphin

Apr 19 2020

marcingu updated the diff for D28745: Skip caching thumbnails on encrypted filesystems.

Review fixes

Apr 19 2020, 9:29 AM · Frameworks, Dolphin

Apr 18 2020

marcingu added a comment to D28745: Skip caching thumbnails on encrypted filesystems.

I improved check if file is on the same filesystem as thumbnails cache, but don't know if we can get rid of KMountPoint completely.

Apr 18 2020, 11:04 AM · Frameworks, Dolphin
marcingu updated the diff for D28745: Skip caching thumbnails on encrypted filesystems.

Checking if file is on the same filesystem as thumbnails cache directory using lstsat

Apr 18 2020, 11:00 AM · Frameworks, Dolphin

Apr 16 2020

marcingu added a comment to D28745: Skip caching thumbnails on encrypted filesystems.

Ok, Thanks! I'll check it this weekend.

Apr 16 2020, 2:55 PM · Frameworks, Dolphin

Apr 15 2020

marcingu added a comment to D28745: Skip caching thumbnails on encrypted filesystems.

This is gonna have an hefty toll on perf as it will add a getmntent syscall to every thumbnail generation.
Using Solid::Device::listFromType would leverage Solid always up-to-date (using events rather thane sysalls) device cache.
I am not sure in the end this is preferable though.

Apr 15 2020, 3:08 PM · Frameworks, Dolphin

Apr 13 2020

marcingu updated the diff for D28746: Show previews on encrypted filesystems.

Removing extra whitespaces

Apr 13 2020, 3:51 PM · Frameworks
marcingu updated the diff for D28745: Skip caching thumbnails on encrypted filesystems.

Removing extra whitespaces

Apr 13 2020, 3:49 PM · Frameworks, Dolphin
marcingu updated the diff for D28746: Show previews on encrypted filesystems.

Moving boolean variables to the front of logic statement.

Apr 13 2020, 10:24 AM · Frameworks
marcingu updated the diff for D28745: Skip caching thumbnails on encrypted filesystems.

Review fixes

Apr 13 2020, 8:19 AM · Frameworks, Dolphin
marcingu updated the diff for D28746: Show previews on encrypted filesystems.

Review fixes

Apr 13 2020, 8:17 AM · Frameworks

Apr 11 2020

marcingu added a dependency for D28745: Skip caching thumbnails on encrypted filesystems: D28746: Show previews on encrypted filesystems.
Apr 11 2020, 12:23 PM · Frameworks, Dolphin
marcingu added a dependent revision for D28746: Show previews on encrypted filesystems: D28745: Skip caching thumbnails on encrypted filesystems.
Apr 11 2020, 12:23 PM · Frameworks
marcingu requested review of D28746: Show previews on encrypted filesystems.
Apr 11 2020, 12:22 PM · Frameworks
marcingu requested review of D28745: Skip caching thumbnails on encrypted filesystems.
Apr 11 2020, 12:17 PM · Frameworks, Dolphin