]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
Merge branch 'for-linus' of git://git.open-osd.org/linux-open-osd
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 18 Dec 2012 17:44:44 +0000 (09:44 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 18 Dec 2012 17:44:44 +0000 (09:44 -0800)
Pull exofs changes from Boaz Harrosh:
 "These are just 3 patches, the last two are bug fixes on the error
  paths in exofs.

  The important patch is the one to osd_uld which adds sysfs info to osd
  devices for use by user-mode clustering discovery software.  I'm
  already sitting on this patch since before February this year, It is
  important for some of the big installation cluster systems, who's been
  compiling their own kernel just for that patch."

Ugh.  The osd_uld patch already went through the SCSI tree, so this was
kind of pointless.  But at least it has the two small error-path fixes..

* 'for-linus' of git://git.open-osd.org/linux-open-osd:
  exofs: don't leak io_state and pages on read error
  exofs: clean up the correct page collection on write error
  osduld: Add osdname & systemid sysfs at scsi_osd class

fs/exofs/inode.c

index b5618104775187787415b67c1d99658f45f8b3d7..d1f80abd8828fcf3d8adadea9246effef03b7e29 100644 (file)
@@ -361,12 +361,12 @@ static int read_exec(struct page_collect *pcol)
        return 0;
 
 err:
-       if (!pcol->read_4_write)
-               _unlock_pcol_pages(pcol, ret, READ);
-
-       pcol_free(pcol);
-
+       if (!pcol_copy) /* Failed before ownership transfer */
+               pcol_copy = pcol;
+       _unlock_pcol_pages(pcol_copy, ret, READ);
+       pcol_free(pcol_copy);
        kfree(pcol_copy);
+
        return ret;
 }
 
@@ -676,8 +676,10 @@ static int write_exec(struct page_collect *pcol)
        return 0;
 
 err:
-       _unlock_pcol_pages(pcol, ret, WRITE);
-       pcol_free(pcol);
+       if (!pcol_copy) /* Failed before ownership transfer */
+               pcol_copy = pcol;
+       _unlock_pcol_pages(pcol_copy, ret, WRITE);
+       pcol_free(pcol_copy);
        kfree(pcol_copy);
 
        return ret;