block/nfs: fix int overflow in nfs_client_open_qdict
PATCH 1/1 block/nfs: fix int overflow in nfs_client_open_qdict
nfs_client_open returns the file size in sectors. This effectively makes it impossible to open files larger than 1TB.
--- block/nfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
block/nfs.c +1 -1
@@ -592,7 +592,7 @@ static int64_t nfs_client_open_qdict(NFSClient *client, QDict *options, int flags, int open_flags, Error **errp) { BlockdevOptionsNfs *opts; -int ret; +int64_t ret; opts =nfs_options_qdict_to_qapi (options, errp);if (opts ==NULL ) {
Signature · 1 line
2.17.1
Quoted 9 lines · Peter Lieven
nfs_client_openreturns the file size in sectors. This effectively makes it impossible to open files larger than 1TB.Fixes a1a42af422d46812f1f0cebe6b230c20409a3731Signed-off-by Peter Lieven <[email protected]>---
block/nfs.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)
The issue seems to be pre-existing to the commit a1a42af422d46812f1f0cebe6b230c20409a3731, but of course that commit touched this code and this patch would not apply before, so it seems okay to me:
Thanks,
Stefano
Quoted 19 lines
block/nfs.c +1
-1@@ -592,7 +592,7 @@ static int64_t nfs_client_open_qdict(NFSClient *client, QDict *options, int flags, int open_flags, Error **errp) { BlockdevOptionsNfs *opts; -int ret; +int64_t ret; opts =nfs_options_qdict_to_qapi (options, errp);if (opts ==NULL ) {Signature · 1 line
2.17.1
Kevin Wolf
AppliedAm 10.12.2020 um 10:00 hat Stefano Garzarella geschrieben:
Quoted 11 lines · Peter Lieven
Quoted 9 lines
nfs_client_openreturns the file size in sectors. This effectively makes it impossible to open files larger than 1TB.Fixes a1a42af422d46812f1f0cebe6b230c20409a3731Signed-off-by Peter Lieven <[email protected]>---
block/nfs.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 3 lines
The issue seems to be pre-existing to the commit
a1a42af422d46812f1f0cebe6b230c20409a3731, but of course that commit touched this code and this patch would not apply before, so it seems okay to me:
I think it's commit c22a0345, which is the one right before a1a42af4. I'll update the commit message accordingly.
Quoted 1 line
Reviewed-by Stefano Garzarella <[email protected]>
Thanks, applied to the block branch.
Kevin