Skip to main content

[xadisk~svn:540] Changes for JIRA issue #132.

  • From: nitin_verma@...
  • To: commits@...
  • Subject: [xadisk~svn:540] Changes for JIRA issue #132.
  • Date: Wed, 21 Aug 2013 14:16:19 +0000

Project:    xadisk
Repository: svn
Revision:   540
Author:     nitin_verma
Date:       2013-08-21 14:16:18 UTC
Link:       

Log Message:
------------
Changes for JIRA issue #132.


Revisions:
----------
540


Modified Paths:
---------------
trunk/src/org/xadisk/filesystem/NativeSession.java


Diffs:
------
Index: trunk/src/org/xadisk/filesystem/NativeSession.java
===================================================================
--- trunk/src/org/xadisk/filesystem/NativeSession.java  (revision 539)
+++ trunk/src/org/xadisk/filesystem/NativeSession.java  (revision 540)
@@ -688,7 +688,7 @@
                             continue;
                         }
                         checkPointDuringModificationAgainstCopy(i - 2, f, 
srcFilesCopied, srcFilesMoved);
-                        commitDeleteFile(fileName);
+                        commitDeleteFile(fileName, 
filesDirectlyWrittenToDisk);
                     } else if (logEntry.getOperationType() == 
TransactionLogEntry.FILE_CREATE) {
                         String fileName = logEntry.getFileName();
                         File f = new File(fileName);
@@ -857,10 +857,29 @@
         }
     }
 
-    private void commitDeleteFile(String fileName) throws IOException {
+    private void commitDeleteFile(String fileName, HashSet<File> 
filesDirectlyWrittenToDisk)
+            throws IOException {
         File f = new File(fileName);
         if (f.exists()) {
-            diskSession.deleteFile(f);
+            try {
+                diskSession.deleteFile(f);
+            } catch(IOException ioe) {
+                if(f.isDirectory()) {
+                    if(f.list().length!=0) {
+                        for(File file: filesDirectlyWrittenToDisk) {
+                            if(file.getParentFile().equals(f)) {
+                                return;
+                                //bug#132 (see testcase there). For a file 
written in heavyWrite mode,
+                                //we ignore general io-operations for that 
file. though such a management
+                                //of one file does not affect any other 
entity - no file or no directory
+                                //except the parent directory for the delete 
operation (as delete-dir
+                                //is dependent upon presence of no child 
objects).
+                            }
+                        }
+                    }
+                }
+                throw ioe;
+            }
         }
     }
 





[xadisk~svn:540] Changes for JIRA issue #132.

nitin_verma 08/21/2013
 
 
Close
loading
Please Confirm
Close