19362: Fix unchecked error.
authorTom Clegg <tom@curii.com>
Tue, 20 Sep 2022 20:45:22 +0000 (16:45 -0400)
committerTom Clegg <tom@curii.com>
Tue, 20 Sep 2022 20:45:22 +0000 (16:45 -0400)
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@curii.com>

services/keep-web/s3.go

index 3c7c2db371f1f3d4adafcb643c24d5978e7db8fc..f98efd8fdfcdf39febe29e84610aea474ccda02d 100644 (file)
@@ -581,6 +581,8 @@ func (h *handler) serveS3(w http.ResponseWriter, r *http.Request) bool {
        }
 }
 
+// Save modifications to the indicated collection in srcfs, then (if
+// successful) ensure they are also reflected in dstfs.
 func (h *handler) syncCollection(srcfs, dstfs arvados.CustomFileSystem, path string) error {
        coll, _ := h.determineCollection(srcfs, path)
        if coll == nil || coll.UUID == "" {
@@ -592,6 +594,9 @@ func (h *handler) syncCollection(srcfs, dstfs arvados.CustomFileSystem, path str
        }
        defer d.Close()
        err = d.Sync()
+       if err != nil {
+               return err
+       }
        snap, err := d.Snapshot()
        if err != nil {
                return err