summaryrefslogtreecommitdiff
path: root/pgfuse.c
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2015-05-07 10:41:34 +0200
committerAndreas Baumann <mail@andreasbaumann.cc>2015-05-07 10:41:34 +0200
commit84261462f3a8fef4bbb1727e7219a720989a4de4 (patch)
tree0d92ef9d73316188fcbbae7a315005dc44e07e99 /pgfuse.c
parent9880157ead1859e940e806f840a250a6605fad8d (diff)
downloadpgfuse-84261462f3a8fef4bbb1727e7219a720989a4de4.tar.gz
pgfuse-84261462f3a8fef4bbb1727e7219a720989a4de4.tar.bz2
fixed WARNING: there is already a transaction in progress in rename and fstat
Diffstat (limited to 'pgfuse.c')
-rw-r--r--pgfuse.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/pgfuse.c b/pgfuse.c
index f41e6b7..c77d70f 100644
--- a/pgfuse.c
+++ b/pgfuse.c
@@ -985,6 +985,7 @@ static int pgfuse_statfs( const char *path, struct statvfs *buf )
res = psql_get_tablespace_locations( conn, location, &nof_locations, data->verbose );
if( res < 0 ) {
+ PSQL_ROLLBACK( conn ); RELEASE( conn );
return res;
}
@@ -1326,11 +1327,13 @@ static int pgfuse_rename( const char *from, const char *to )
from_id = psql_read_meta_from_path( conn, from, &from_meta );
if( from_id < 0 ) {
+ PSQL_ROLLBACK( conn ); RELEASE( conn );
return from_id;
}
to_id = psql_read_meta_from_path( conn, to, &to_meta );
if( to_id < 0 && to_id != -ENOENT ) {
+ PSQL_ROLLBACK( conn ); RELEASE( conn );
return to_id;
}
@@ -1340,13 +1343,16 @@ static int pgfuse_rename( const char *from, const char *to )
if( S_ISREG( to_meta.mode ) ) {
if( strcmp( from, to ) == 0 ) {
/* source equal to destination? This should succeed */
+ PSQL_ROLLBACK( conn ); RELEASE( conn );
return 0;
} else {
/* otherwise bail out */
+ PSQL_ROLLBACK( conn ); RELEASE( conn );
return -EEXIST;
}
}
/* TODO: handle all other cases */
+ PSQL_ROLLBACK( conn ); RELEASE( conn );
return -EINVAL;
}