Thread (6 messages) 6 messages, 5 authors, 2021-11-15

Re: [PATCH v3 RESEND] fcntl: Add 32bit filesystem mode

From: Linus Walleij <hidden>
Date: 2020-11-17 23:39:13
Also in: linux-ext4, linux-fsdevel, qemu-devel

On Tue, Oct 13, 2020 at 11:22 AM Dave Martin [off-list ref] wrote:
quoted
      case F_SETFD:
              err = 0;
              set_close_on_exec(fd, arg & FD_CLOEXEC);
+             if (arg & FD_32BIT_MODE)
+                     filp->f_mode |= FMODE_32BITHASH;
+             else
+                     filp->f_mode &= ~FMODE_32BITHASH;
This seems inconsistent?  F_SETFD is for setting flags on a file
descriptor.  Won't setting a flag on filp here instead cause the
behaviour to change for all file descriptors across the system that are
open on this struct file?  Compare set_close_on_exec().

I don't see any discussion on whether this should be an F_SETFL or an
F_SETFD, though I see F_SETFD was Ted's suggestion originally.
I cannot honestly say I know the semantic difference.

I would ask the QEMU people how a user program would expect
the flag to behave.

Yours,
Linus Walleij
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help