LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 01-28-2010, 12:42 PM   #1
slacker_et
Member
 
Registered: Dec 2009
Distribution: Slackware
Posts: 138

Rep: Reputation: 27
gedit: can not modify files on CIFS filesystem


I'm having issues with gedit saving files on a CIFS mounted share.
The system I'm using is an OpenSuse 10.3. And I have my Windows shared mounted as a CIFS filesystem.
I am mounting the CIFS with default permissions/parameters.
And the "mount" command displays it mounted as:

"type cifs (rw,mand)"

What I'm encountering is that gedit can not modify any files on this CIFS filesystem; not even a file it just created.
Gedit can create a file on this CIFS filesystem. But it can only save the file once. Any additional saves will fail.
The message that gets displayed is a non-informative:

"Could not save the file: $FILENAME"

I can not find ANY errors in log files OR even at the commandline when I start gedit from the prompt.

BUT all other programs; vi, touch, cat, emacs, sed, etc..; do not have any problems making changes to these very same files.

Has anyone else experienced this behavior from gedit ?

Thanks;
--ET
 
Old 01-28-2010, 01:07 PM   #2
David1357
Senior Member
 
Registered: Aug 2007
Location: South Carolina, U.S.A.
Distribution: Ubuntu, Fedora Core, Red Hat, SUSE, Gentoo, DSL, coLinux, uClinux
Posts: 1,302
Blog Entries: 1

Rep: Reputation: 107Reputation: 107
Quote:
Originally Posted by slacker_et View Post
Has anyone else experienced this behavior from gedit?
I could not duplicate the problem on Ubuntu 8.10 and RedHat El5.4.
 
Old 01-29-2010, 09:22 AM   #3
slacker_et
Member
 
Registered: Dec 2009
Distribution: Slackware
Posts: 138

Original Poster
Rep: Reputation: 27
I'm probably not the only person who has ever encountered this situation.
So just in case someone else ever encounters the same situation; I'll post some of my own investigation.

Running an strace on gedit during one of these failures and logging it. I've noticed this output:

Starting a log and using strace:
Code:
> script -a eric.log 2>&1
> strace gedit eric.tmp
Portion of log where I think it is failing to save the file:
Code:
 8749 open("/SFS/user/wp/trimmer/windows/eric.tmp", O_WRONLY|O_CREAT|O_EXCL, 0666) = -1 EEXIST (File exists)
 8750 open("/SFS/user/wp/trimmer/windows/eric.tmp", O_RDWR) = 16
 8751 gettimeofday({1264708337, 189926}, NULL) = 0
 8752 gettimeofday({1264708337, 190045}, NULL) = 0
 8753 fstat(16, {st_mode=S_IFREG|0644, st_size=5, ...}) = 0
 8754 lstat("/SFS/user/wp/trimmer/windows/eric.tmp", {st_mode=S_IFREG|0644, st_size=5, ...}) = 0
 8755 umask(077)                              = 022
 8756 gettimeofday({1264708337, 190294}, NULL) = 0
 8757 open("/SFS/user/wp/trimmer/windows/.gedit-save-RWYA7U", O_RDWR|O_CREAT|O_EXCL, 0600) = 17
 8758 umask(022)                              = 077
 8759 fchown(17, 4086, 1001)                  = 0
 8760 fchmod(17, 0100644)                     = 0
 8761 lseek(17, 0, SEEK_SET)                  = 0
 8762 ftruncate(17, 0)                        = 0
 8763 write(17, "dddd", 4)                    = 4
 8764 write(17, "\n", 1)                      = 1
 8765 rename("/SFS/user/wp/trimmer/windows/eric.tmp", "/SFS/user/wp/trimmer/windows/eric.tmp~") = -1 ETXTBSY (Text file busy)
 8766 close(17)                               = 0
 8767 unlink("/SFS/user/wp/trimmer/windows/.gedit-save-RWYA7U") = 0
 8768 close(16)                               = 0
I think it's "-1 ETXTBSY (Text file busy)" that is the clue to the problem. But not being a programmer by trade; I'm not certain what it means.

I'll continue to investigate.
In the mean time; doesn't anyone else know what might be going wrong ?


Thanks;
--ET
 
Old 01-30-2010, 04:57 AM   #4
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
What kind of windows system is this. There is a bug with the Windows home server that doesn't allow you to edit files, even using Windows. You need to copy the file to your client machine, edit it, and then replace the original.

It sounds like it may be a locking problem.

From the Samba HOWTO & Reference Guide:
Code:
The second class of locking is the deny modes. These are set by an application
when it opens a file to determine what types of access should be allowed
simultaneously with its open. A client may ask for DENY NONE, DENY READ,
DENY WRITE, or DENY ALL. There are also special compatibility modes called
DENY FCB and DENY DOS.
I'm not sure if this is the responsibility of the client or the cifs kernel driver.

From "Advanced Programming in the Unix Environment"

Code:
O_CREAT  Create the file if it doesn't exist. ...

O_EXCL   Generate an errro if O_CREAT is also specified and the file already exists.
Notice the first two lines of your strace segment. The first call fails. That is because the file already existed and tlhe O_CREAT & O_EXCL flags were used. So gedit tried again. This time in Read/Write mode. So far, this looks OK.

Code:
8765 rename("/SFS/user/wp/trimmer/windows/eric.tmp", "/SFS/user/wp/trimmer/windows/eric.tmp~") = -1 ETXTBSY (Text file busy)
This error occurred when gedit tried to rename the file to a temporary name "eric.tmp~". This file has a file handle (fd) of 16. I think that for windows, the file should be closed before renaming. For an inode based filesystem, this wouldn't be a problem. You can rename a file, but still retain the same inode that you opened. (even if you deleted the file)

Note that you could have left out later lines where gedit handled this situation.

One problem may be Windows' CIFS support not being up to par.

Can you try a different editor? (Or rhetorically, a Samba server )

Last edited by jschiwal; 01-30-2010 at 05:00 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
mount error: cifs filesystem not supported by the system pazo Linux - General 2 12-18-2007 10:15 AM
xmms stops while playing songs from CIFS filesystem ruffles Linux - Networking 0 06-08-2007 08:31 AM
Can Nautilus add CIFS mounts to filesystem? adma96 Fedora 1 11-29-2006 06:45 AM
Can Nautilus add CIFS mounts to filesystem? adma96 Fedora 1 11-28-2006 03:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 12:57 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration