taskThe GNU Hurd - Tasks: task #2490, Fatfs locks a directory when it is...

 
 

task #2490: Fatfs locks a directory when it is already locked

Submitter:  Marco Gerards <marco_g>
Submitted:  -
   
 
Category:  FAT filesystem Should Start On:  Sat 02 Aug 2003 12:00:00 AM UTC
Should be Finished on:  Wed 31 Mar 2004 12:00:00 AM UTC Priority:  * 7 - High
Status:  None Privacy:  Public
Assigned to:  marco_g Percent Complete:  50%
Open/Closed:  Open Planned Release:  None
Effort:  3.00
Wiki-like text discussion box: 


* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 11 Mar 2004 10:30:17 PM UTC, comment #2: 

Thomas, Roland and me agreed on the interface change.  This needs to be implemented now.  The read side you already implemented.  I will make this task depend on that patch.

Marcus Brinkmann <marcus>
Group administrator
Mon 11 Aug 2003 08:35:24 PM UTC, comment #1: 

I've tried changing the diskfs_node_update interface and its callers. This is a lot of work, also the callers of some callers have to be changed (diskfs_file_change for example).

Another solution I thought about can't work. That solution was using a rwlock to lock individual directory entries. This is not possible because the directory needs to be mmapped and a lock is required when creating a pager for a file. (See diskfs_get_filemap).



Marco Gerards <marco_g>
Group Member
-, original submission:  

Fatfs needs to lock the directory that holds a file in order to write
the metadata of a file to disk. This happens in the function
write_node.

The problem is that this directory could have been locked by one of
the callers of write_node. So locking the directory is not safe
because the directory could have been locked (and that makes the
thread hang). Not locking the directory isn't safe either because it
introduces race conditions.

We can't make a special case here like we did for read_node because
there are too many callers, all with different behavior.

I propose to modify the interfaces for diskfs_update_node and
diskfs_write_disknode. By adding a flag to notice these functions if
the directory is locked, or even better by passing the "dp" to the
function if it is locked (as Roland once proposed for read_node).

I even like to make similar changes for diskfs_cached_lookup so fatfs
and other filesystems that have similar problems can support nfs.

Marco Gerards <marco_g>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

Only logged-in users can vote.

 

Follow 6 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2004-03-11 marcus Should Start On2003-08-02 2003-08-02
    Should be Finished on2003-08-02 2004-03-31
    Percent Complete30% 50%
    Effort0.00 3.00
    Dependencies- Depends on patch #2756
2003-08-11 marco_g Percent CompleteNone None

Back to the top

Powered by Savane 3.13-8ccc.
Corresponding source code