Re: [GIT PULL] Block updates for 6.11-rc1

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

 



On 15/07/2024 22:32, Linus Torvalds wrote:
Note the statx change for atomic writes will cause a trivial conflict
with a patch that went into the 6.9 kernel via the vfs tree later than
what the 6.11 block tree was based on. Easy to resolve, only mentioning
it for completeness sake.
It may be easy to resolve, but as I was resolving it I threw up in my
mouth a little.

That whole

         struct inode *backing_inode;
         ...
         backing_inode = d_backing_inode(path.dentry);
         if (S_ISBLK(backing_inode->i_mode))
                 bdev_statx(backing_inode, stat, request_mask);

does not belong in the generic stat helper. The whole*point*  of
bdev_statx() is to not need that kind of bdev-specific knowledge.

So I rewrote it to be

         if (S_ISBLK(stat->mode))
                 bdev_statx(path, stat, request_mask);

instead, and that whole "backing_inode" stuff is now inside bdev_statx().

Because wasn't that the whole point of abstracting this out, so that
block devices could do their own thing?

And if the backing inode is a special block device, but the "front"
inode doesn't say S_IFBLK, something is very screwed up.

But hey, maybe I screwed something up. But randomly having that whole
"d_backing_inode()" logic in there seemed entirely against the
abstraction layering.

This code bdev statx originates in 2d985f8c6b91b.

In looking at the lore history for that commit, Eric was passing the path at one stage:

https://lore.kernel.org/linux-fsdevel/YrgPOHarxLdMt2m2@xxxxxxxxxxxxx/

With that change (to pass the backing inode) came that big comment in bdev_statx{_dioalign}() about what backing_inode is - I am not sure on the value of that now.

Anyway, the change works ok for me.

John




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux