Bug 43839 - (FS SMBFS)Files that already contains data on samba mounted volumes can not be truncated when running kernel version 2.2.19-7.0.1
(FS SMBFS)Files that already contains data on samba mounted volumes can not b...
Status: CLOSED CURRENTRELEASE
Product: Red Hat Linux
Classification: Retired
Component: kernel (Show other bugs)
7.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Arjan van de Ven
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-06-07 10:54 EDT by Kjell Uddeborg
Modified: 2007-04-18 12:33 EDT (History)
2 users (show)

See Also:
Fixed In Version: 2.4.20-19.7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2003-08-11 16:57:26 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Kjell Uddeborg 2001-06-07 10:54:55 EDT
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)

Description of problem:
When mounting a samba volume, files that already contains data can not be 
truncated. Problem occurs with kernel version 2.2.19-7.0.1. With kernel 
version 2.2.17-14 the problem does not exist. I have not tried with the 
latest 2.4 kernel yet.

How reproducible:
Always

Steps to Reproduce:
1.Run the included program on a system with kernel 2.2.19-7.0.1.
2.As command line argument specify a file on a samba mounted volume.
3.Make sure that the file already contains some data like the alphabet for 
example.
	

Actual Results:  ftruncate: Permission denied

Expected Results:  No error message

Additional info:

int main(int argc, char *argv[])
{
  int fd, i;
  char buf[20];
  
  if (argc != 2)
    {
      fprintf(stderr, "usage: %s file\n", argv[0]);
      return 1;
    }
  if ((fd = open(argv[1], O_RDWR|O_CREAT, S_IRUSR|S_IWUSR)) < 0)
    {
      perror("open");
      return 1;
    }
  if (read(fd, buf, sizeof buf) == -1)
    {
      perror("read");
      return 1;
    }
  if (ftruncate(fd, 0) == -1)
    {
      perror("ftruncate");
      return 1;
    }
  return 0;
}
Comment 1 Kjell Uddeborg 2001-06-07 11:04:29 EDT
Titel incorrect, sould read:

Files that already contains data on samba mounted volumes can not be truncated 
when running kernel version 2.2.19-7.0.1
Comment 2 Trond Eivind Glomsrxd 2001-06-08 12:41:11 EDT
It works for with client RHL 7.1 and server RHL 6.2 (running 2.2.19-6.2.1, which
is the same kernel with some packaging changes for RHL 6.x):

//oslo.devel.redhat.com/tmp /fooo smbfs rw 0 0

[root@halden /fooo]# ls -l
totalt 1
-rwxr-xr-x    1 root     root            4 jun  8 12:38 ab
-rwxr-xr-x    1 root     root           30 jun  8 12:33 foo2
[root@halden /fooo]# ~teg/foo4 ab
[root@halden /fooo]# ls -l
totalt 1
-rwxr-xr-x    1 root     root            0 jun  8 12:38 ab
-rwxr-xr-x    1 root     root           30 jun  8 12:33 foo2
[root@halden /fooo]#

Same when mounting the 6.2 system on itself...
Comment 3 Göran Uddeborg 2001-06-10 17:10:53 EDT
To clarify things, this happens with the 7.0 machine as client.  The server was
an NT.
Comment 4 Trond Eivind Glomsrxd 2001-06-10 17:26:47 EDT
Samba is a server application only... reopening, and changing to kernel component.
Comment 5 Kjell Uddeborg 2001-06-11 11:42:54 EDT
Just to clarify things a little bit more, probably does not make much 
difference:
The server is not an NT4 machine but a Windows 2000 machine.
Comment 6 Kjell Uddeborg 2003-08-11 16:57:26 EDT
Works fine in version 2.4.20-19.7.

Note You need to log in before you can comment on or make changes to this bug.