Kernel Newbies archive on lore.kernel.org
 help / color / Atom feed
* Need advice about do we need this if condition
@ 2019-04-17  5:25 Саша Ковтуненко
  2019-04-17  7:56 ` Valdis Klētnieks
  0 siblings, 1 reply; 3+ messages in thread
From: Саша Ковтуненко @ 2019-04-17  5:25 UTC (permalink / raw)
  To: kernelnewbies

[-- Attachment #1.1: Type: text/plain, Size: 220 bytes --]

hello I am trying to fix https://bugzilla.kernel.org/show_bug.cgi?id=202935
I found cause
https://github.com/torvalds/linux/blob/master/fs/cifs/cifsfs.c#L1076 not
sure is it correct to remove such condition ?

Thanks
AK

[-- Attachment #1.2: Type: text/html, Size: 462 bytes --]

<div dir="ltr"><div>hello I am trying to fix <a href="https://bugzilla.kernel.org/show_bug.cgi?id=202935" target="_blank">https://bugzilla.kernel.org/show_bug.cgi?id=202935</a>  I found cause <a href="https://github.com/torvalds/linux/blob/master/fs/cifs/cifsfs.c#L1076">https://github.com/torvalds/linux/blob/master/fs/cifs/cifsfs.c#L1076</a> not sure is it correct to remove such condition ?</div><div><br></div><div>Thanks</div><div>AK<br></div><br></div>

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Need advice about do we need this if condition
  2019-04-17  5:25 Need advice about do we need this if condition Саша Ковтуненко
@ 2019-04-17  7:56 ` Valdis Klētnieks
  2019-04-17 13:32   ` Steve French
  0 siblings, 1 reply; 3+ messages in thread
From: Valdis Klētnieks @ 2019-04-17  7:56 UTC (permalink / raw)
  To: B1C0D8C0 AACEC2D2D3CDC5CDCACE, Alexander Viro
  Cc: linux-fsdevel, linux-kernel, kernelnewbies

On Wed, 17 Apr 2019 08:25:22 +0300

(Adding Al Viro and the linux-fsdevel lists, as at the very least, the manpage
for the syscall needs some clarification...)

> hello I am trying to fix https://bugzilla.kernel.org/show_bug.cgi?id=202935

So - convince us that it's in fact a "bug" and not a restriction.

> I found cause
> https://github.com/torvalds/linux/blob/master/fs/cifs/cifsfs.c#L1076 not
> sure is it correct to remove such condition ?

Does the CIFS protocol support copying from a file to another location in the
same file? Was it intended to work on *any* filesystem?

(For that matter, the manpage for the syscall is unclear on whether having both
file descriptors open on the same file is OK or not - for bonus ambiguity
points, there's exactly zero discussion of what happens if source and
destination overlap destructively).


_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Need advice about do we need this if condition
  2019-04-17  7:56 ` Valdis Klētnieks
@ 2019-04-17 13:32   ` Steve French
  0 siblings, 0 replies; 3+ messages in thread
From: Steve French @ 2019-04-17 13:32 UTC (permalink / raw)
  To: Valdis Klētnieks
  Cc: linux-fsdevel, LKML, B1C0D8C0 AACEC2D2D3CDC5CDCACE,
	Alexander Viro, kernelnewbies

On Wed, Apr 17, 2019 at 2:59 AM Valdis Klētnieks
<valdis.kletnieks@vt.edu> wrote:
>
> On Wed, 17 Apr 2019 08:25:22 +0300
>
> (Adding Al Viro and the linux-fsdevel lists, as at the very least, the manpage
> for the syscall needs some clarification...)
>
> > hello I am trying to fix https://bugzilla.kernel.org/show_bug.cgi?id=202935
>
> So - convince us that it's in fact a "bug" and not a restriction.
>
> > I found cause
> > https://github.com/torvalds/linux/blob/master/fs/cifs/cifsfs.c#L1076 not
> > sure is it correct to remove such condition ?
>
> Does the CIFS protocol support copying from a file to another location in the
> same file? Was it intended to work on *any* filesystem?

Looks like it should be allowed on the same file as long as the source
and target file ranges do not overlap

See https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-fscc/1ee611b7-43f0-468c-8a9d-28f04cdc3376
section 2.3.7.2 and 2.3.8
Server returns STATUS_NOT_SUPPORTED if "The source and target
destination ranges overlap on the same file."

and line 112 and following of smb2_ioctl_filesys.c in Samba code

https://git.samba.org/?p=samba.git;a=blob;f=source3/smbd/smb2_ioctl_filesys.c;h=8a9c8c64ec9ddbca4623251555f4792d76aa6e44;hb=refs/heads/master#l112

> (For that matter, the manpage for the syscall is unclear on whether having both
> file descriptors open on the same file is OK or not - for bonus ambiguity
> points, there's exactly zero discussion of what happens if source and
> destination overlap destructively).
>


-- 
Thanks,

Steve

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-17  5:25 Need advice about do we need this if condition Саша Ковтуненко
2019-04-17  7:56 ` Valdis Klētnieks
2019-04-17 13:32   ` Steve French

Kernel Newbies archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/kernelnewbies/0 kernelnewbies/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 kernelnewbies kernelnewbies/ https://lore.kernel.org/kernelnewbies \
		kernelnewbies@kernelnewbies.org kernelnewbies@archiver.kernel.org
	public-inbox-index kernelnewbies


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernelnewbies.kernelnewbies


AGPL code for this site: git clone https://public-inbox.org/ public-inbox